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

Parse unary-tests expression with boolean and conjunction/disjunction #435

Merged
merged 4 commits into from
Jun 29, 2022
Merged
Changes from 1 commit
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 @@ -185,12 +185,27 @@ class InterpreterUnaryTest
it should "compare to a conjunction (and)" in {
evalUnaryTests(true, "true and true") shouldBe ValBoolean(true)
evalUnaryTests(true, "false and true") shouldBe ValBoolean(false)

evalUnaryTests(true, "true and null") shouldBe ValBoolean(false)
saig0 marked this conversation as resolved.
Show resolved Hide resolved
evalUnaryTests(true, "false and null") shouldBe ValBoolean(false)

evalUnaryTests(true, """true and "otherwise" """) shouldBe ValBoolean(
false)
evalUnaryTests(true, """false and "otherwise" """) shouldBe ValBoolean(
false)
}

it should "compare to a disjunction (or)" in {
evalUnaryTests(true, "true or true") shouldBe ValBoolean(true)
evalUnaryTests(true, "false or true") shouldBe ValBoolean(true)
evalUnaryTests(true, "false or false") shouldBe ValBoolean(false)

evalUnaryTests(true, "true or null") shouldBe ValBoolean(true)
evalUnaryTests(true, "false or null") shouldBe ValBoolean(false)

evalUnaryTests(true, """true or "otherwise" """) shouldBe ValBoolean(true)
evalUnaryTests(true, """false or "otherwise" """) shouldBe ValBoolean(
false)
}

"A date" should "compare with '<'" in {
Expand Down