From e0ca664381066668073270ce1fe3e0813b25bfb1 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 26 Mar 2024 13:35:27 -0400 Subject: More bool ops --- tests/test_conditional_4.tnsl | 16 ++++++++++++++++ tests/test_conditional_5.tnsl | 20 ++++++++++++++++++++ tests/test_conditional_6.tnsl | 8 ++++++++ 3 files changed, 44 insertions(+) create mode 100644 tests/test_conditional_4.tnsl create mode 100644 tests/test_conditional_5.tnsl create mode 100644 tests/test_conditional_6.tnsl (limited to 'tests') diff --git a/tests/test_conditional_4.tnsl b/tests/test_conditional_4.tnsl new file mode 100644 index 0000000..d31944a --- /dev/null +++ b/tests/test_conditional_4.tnsl @@ -0,0 +1,16 @@ + +/; main [int] + int a = 0 + int b = 69 + int c = 70 + + /; if (a < b && b > c) + return c + ;; else if (b > c && a < b) + return a + ;; else if (a > b && b > c) + return 1 + ;/ + + return b +;/ diff --git a/tests/test_conditional_5.tnsl b/tests/test_conditional_5.tnsl new file mode 100644 index 0000000..2c68c17 --- /dev/null +++ b/tests/test_conditional_5.tnsl @@ -0,0 +1,20 @@ + +/; main [int] + + /; if (true && false) + return 0 + ;; else if (false && true) + return 1 + ;; else if (false && false) + return 2 + ;/ + + /; if (false || false) + return 3 + ;; else if (true || false) + return 69 + ;/ + + return 4 + +;/ diff --git a/tests/test_conditional_6.tnsl b/tests/test_conditional_6.tnsl new file mode 100644 index 0000000..051b0f3 --- /dev/null +++ b/tests/test_conditional_6.tnsl @@ -0,0 +1,8 @@ +/; main [int] + bool a = false + /; if (false || !a && true) + return 69 + ;/ + + return 0 +;/ -- cgit v1.2.3