| 1 | type Bytes = [3]u8 |
| 2 | type Strs = [3]string |
| 3 | |
| 4 | fn test_none() { |
| 5 | b := ?Bytes(none) |
| 6 | println(b) |
| 7 | assert b == none |
| 8 | |
| 9 | c := ?Strs(none) |
| 10 | println(c) |
| 11 | assert c == none |
| 12 | } |
| 13 | |
| 14 | fn test_non_none() { |
| 15 | b := ?Bytes([u8(1), 2, 3]!) |
| 16 | println(b) |
| 17 | assert b != none |
| 18 | assert b?[2] == 3 |
| 19 | |
| 20 | c := ?Strs(['a', 'b', 'c']!) |
| 21 | println(c) |
| 22 | assert c != none |
| 23 | assert c?[2] == 'c' |
| 24 | } |
| 25 |