commit
657f357fc6
4 changed files with 42 additions and 0 deletions
@ -0,0 +1,7 @@ |
||||
project('ternary operator', 'c') |
||||
|
||||
one = true ? 1 : error('False branch should not be evaluated') |
||||
two = false ? error('True branch should not be evaluated.') : 2 |
||||
|
||||
assert(one == 1, 'Return value from ternary true is wrong.') |
||||
assert(two == 2, 'Return value from ternary false is wrong.') |
@ -0,0 +1,3 @@ |
||||
project('nested ternary', 'c') |
||||
|
||||
x = true ? (false ? 1 : 0) : 2 |
Loading…
Reference in new issue