| 1 | fn test_main() { |
| 2 | _ := if true { [0]! } else { [1]! } |
| 3 | _ := if true { [0] } else { [1] } |
| 4 | |
| 5 | a := if true { [0]! } else { [1]! } |
| 6 | b := if true { [0] } else { [1] } |
| 7 | assert a.str() == '[0]' |
| 8 | assert b.str() == '[0]' |
| 9 | } |
| 10 | |
| 11 | fn test_match() { |
| 12 | grid_size := 1 |
| 13 | |
| 14 | _ := match grid_size { |
| 15 | 3 { ['Small', '3x3']! } |
| 16 | 4 { ['Classic', '4x4']! } |
| 17 | 5 { ['Big', '5x5']! } |
| 18 | else { ['Large', '6x6']! } |
| 19 | } |
| 20 | |
| 21 | w := match grid_size { |
| 22 | 3 { ['Small', '3x3']! } |
| 23 | 4 { ['Classic', '4x4']! } |
| 24 | 5 { ['Big', '5x5']! } |
| 25 | else { ['Large', '6x6']! } |
| 26 | } |
| 27 | |
| 28 | assert w.str() == "['Large', '6x6']" |
| 29 | } |
| 30 | |