| 1 | struct Empty { |
| 2 | empty string |
| 3 | } |
| 4 | |
| 5 | fn print_error() ?[]Empty { |
| 6 | mut test := []Empty{} |
| 7 | test << Empty{ |
| 8 | empty: 'Test' |
| 9 | } |
| 10 | if test[0].empty != '' { |
| 11 | return none |
| 12 | } |
| 13 | return test |
| 14 | } |
| 15 | |
| 16 | fn test_option_expr_with_array_value() { |
| 17 | test_error := print_error() or { |
| 18 | eprintln(err) |
| 19 | []Empty{} |
| 20 | } |
| 21 | println(test_error) |
| 22 | assert '${test_error}' == '[]' |
| 23 | } |
| 24 |