Skip to content

Commit

Permalink
test: Verify string() function invocation
Browse files Browse the repository at this point in the history
Add new test cases for string and null arguments.

(cherry picked from commit b56d41b)
  • Loading branch information
saig0 authored and github-actions[bot] committed Oct 23, 2023
1 parent 2cb715c commit 499d0b3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ class BuiltinConversionFunctionsTest extends AnyFlatSpec with Matchers with Feel
eval(""" string(1.1) """) should be(ValString("1.1"))
}

it should "convert a string" in {
eval(""" string("hello") """) should be (ValString("hello"))
}

it should "convert Boolean" in {

eval(""" string(true) """) should be(ValString("true"))
Expand Down Expand Up @@ -250,6 +254,10 @@ class BuiltinConversionFunctionsTest extends AnyFlatSpec with Matchers with Feel
eval(""" string(@"P1Y2M") """) should be(ValString("P1Y2M"))
}

it should "return null if the argument is null" in {
eval(""" string(null) """) should be (ValNull)
}

"A duration() function" should "convert day-time-String" in {

eval(""" duration(x) """, Map("x" -> "P2DT20H14M")) should be(ValDayTimeDuration("P2DT20H14M"))
Expand Down

0 comments on commit 499d0b3

Please sign in to comment.