8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / common / ficl / test / testcase.fr
blob9e3f260b130a31e7bfcb4ff624fb10e97880b55a
3 1 2 3
4 .s-simple
5 cr
7 : test-case ( n -- )
8         case
9                 0 of
10                         ." zero"
11                         endof
12                 1 of
13                         ." one"
14                         endof
15                 ." something else"
16         endcase
17         cr
18         ;
21 see test-case
23 .( You should see [3] 1 2 3 -> )
24 .s-simple
25 .( <-) cr
27 .( You should see "zero": )
28 0 test-case
30 .( You should see "one": )
31 1 test-case
33 .( You should see "something else": )
34 324 test-case
36 .( You should still see [3] 1 2 3 -> )
37 .s-simple
38 .( <-) cr
41 : test-case-2 ( n -- )
42         case
43                 0 of
44                         ." zero"
45                         fallthrough
46                 1 of
47                         ." one"
48                         endof
49                 2 of
50                         ." two"
51                         fallthrough
52                 ." something else"
53         endcase
54         cr
55         ;
58 see test-case-2
62 .( You should once more see [3] 1 2 3 -> )
63 .s-simple
64 .( <-) cr
66 .( You should see "zeroone": )
67 0 test-case-2
69 .( You should see "one": )
70 1 test-case-2
72 .( You should see "two": )
73 2 test-case-2
75 .( You should see "something else": )
76 324 test-case-2
78 .( You should still see [3] 1 2 3 -> )
79 .s-simple
80 .( <-) cr
84 bye