| author | |
| committer | |
| log | 98faf4f74984db615ba62de285308dfc5092ec7c |
| tree | 07cca4cc3aabf47ed00bd7a2eba79eaa35aae542 |
| parent | c715309bc5de874d3d418c80095d50f7efc17001 |
closes #311 files changed, 14 insertions(+), 0 deletions(-)
test/cases/bool.zig+14| ... | ... | @@ -30,3 +30,17 @@ fn boolCmp() { |
| 30 | 30 | fn testBoolCmp(a: bool, b: bool) -> bool { |
| 31 | 31 | a == b |
| 32 | 32 | } |
| 33 | ||
| 34 | fn shortCircuitAndOr() { | |
| 35 | @setFnTest(this); | |
| 36 | ||
| 37 | var a = true; | |
| 38 | a &&= false; | |
| 39 | assert(!a); | |
| 40 | a &&= true; | |
| 41 | assert(!a); | |
| 42 | a ||= false; | |
| 43 | assert(!a); | |
| 44 | a ||= true; | |
| 45 | assert(a); | |
| 46 | } |