| 1 | fn test_nested_if_expr_method_call() { |
| 2 | str_from_nested_exp1 := if true { |
| 3 | if true { 'foo.bar' } else { 'foo.bar.baz' }.all_after('foo.') |
| 4 | } else { |
| 5 | 'foo' |
| 6 | } |
| 7 | println(str_from_nested_exp1) |
| 8 | assert str_from_nested_exp1 == 'bar' |
| 9 | |
| 10 | str_from_nested_exp2 := if true { |
| 11 | (if true { 'foo.bar' } else { 'foo.bar.baz' }).all_after('foo.') |
| 12 | } else { |
| 13 | 'foo' |
| 14 | } |
| 15 | println(str_from_nested_exp2) |
| 16 | assert str_from_nested_exp2 == 'bar' |
| 17 | |
| 18 | str_from_nested_exp3 := if true { |
| 19 | 'foo' |
| 20 | } else { |
| 21 | if true { 'foo.bar' } else { 'foo.bar.baz' }.all_after('foo.') |
| 22 | } |
| 23 | println(str_from_nested_exp3) |
| 24 | assert str_from_nested_exp3 == 'foo' |
| 25 | |
| 26 | str_from_nested_exp4 := if true { |
| 27 | 'foo' |
| 28 | } else { |
| 29 | (if true { 'foo.bar' } else { 'foo.bar.baz' }).all_after('foo.') |
| 30 | } |
| 31 | println(str_from_nested_exp4) |
| 32 | assert str_from_nested_exp4 == 'foo' |
| 33 | } |
| 34 | |