Skip to content

Commit

Permalink
chore(interpreter): add a test for whitespaced named parameters (#381)
Browse files Browse the repository at this point in the history
* chore(interpreter): add a test for whitespaced named parameters
  • Loading branch information
p3trur0 committed Jan 5, 2022
1 parent 5749f94 commit 4cd12fb
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit 4cd12fb

Please sign in to comment.