aboutsummaryrefslogtreecommitdiff
path: root/test/when.tm
blob: 77c97af58a7e1d9aafb0f617307af53fdcbe30ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)
    = Int64(23)?