Skip to content

Commit

Permalink
test: Verify input variable in expressions
Browse files Browse the repository at this point in the history
Add a test case to verify that the input variable is not available outside of an unary-test expression.
  • Loading branch information
saig0 committed Aug 20, 2024
1 parent 76aa695 commit 0901800
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,17 @@ class InterpreterExpressionTest
""") should returnResult(1)
}

"The special variable '?' (input value)" should "be available in an unary-test" in {

evaluateExpression("5 in ? < 10") should returnResult(true)
evaluateExpression("5 in ? < 3") should returnResult(false)
}

it should "not be available outside an unary-test" in {

evaluateExpression("? < 10") should failWith(
"""failed to evaluate expression '? < 10': No input value available. '?' can only be used inside an unary-test expression."""
)
}

}

0 comments on commit 0901800

Please sign in to comment.