| 1 | pub struct Struct1 { |
| 2 | pub mut: |
| 3 | strings ?[]string |
| 4 | } |
| 5 | |
| 6 | fn test_main() { |
| 7 | mut s1 := Struct1{} |
| 8 | assert s1.strings == none |
| 9 | s1.strings = [] |
| 10 | assert s1.strings? == [] |
| 11 | s1.strings? << ['foo'] |
| 12 | s1.strings? << ['bar'] |
| 13 | dump(s1) |
| 14 | assert s1.strings? == ['foo', 'bar'] |
| 15 | |
| 16 | s1.strings = [] |
| 17 | assert s1.strings? == [] |
| 18 | |
| 19 | s1.strings? << ['foo'] |
| 20 | assert s1.strings? == ['foo'] |
| 21 | } |
| 22 |