Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(interpreter): add a test for whitespaced named parameters #381

Merged
merged 3 commits into from
Jan 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ class InterpreterFunctionTest
eval(""" index of([1,2,3,2],2)[1] """) should be(ValNumber(2))
}

it should "be properly evaluated when parameters contain whitespaces" in {
eval("""number(from: "1.000.000,01", decimal separator:",", grouping separator:".")""") should be(ValNumber(1_000_000.01))
}

it should "be invoked with one named parameter containing whitespaces" in {
val functions =
Map("f" -> eval("""function(test name) `test name` + 1""").asInstanceOf[ValFunction])

eval("f(test name:1)", functions = functions) should be(ValNumber(2))
eval("f(test name:2)", functions = functions) should be(ValNumber(3))
}

"An external java function definition" should "be invoked with one double parameter" in {

val functions = Map(
Expand Down