From 1c909015534ac9e94d48d1fe61febb6299ba3da6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 6 Mar 2025 18:39:23 -0500 Subject: [PATCH] Add 'when' test --- test/when.tm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/when.tm diff --git a/test/when.tm b/test/when.tm new file mode 100644 index 0000000..89525c6 --- /dev/null +++ b/test/when.tm @@ -0,0 +1,16 @@ +# Tests for the 'when' block + +func main(): + str := "B" + when str is "A": + fail("First") + is "B": + say("Success") + is "C": + fail("Third") + + n := 23 + >> when n is 1: Int64(1) + is 2: Int64(2) + is 21 + 2: Int64(23) + = 23 : Int64?