Mercurial > hg > octave-nkf
diff src/pt-binop.cc @ 12822:46e0d66596f2
codesprint: Add test for do_braindead_shortcircuit_evaluation
* pt-binop.cc: Add test for do_braindead_shortcircuit_evaluation
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 16 Jul 2011 13:17:23 -0700 |
parents | 12df7854fa7c |
children | 5d18231eee00 |
line wrap: on
line diff
--- a/src/pt-binop.cc +++ b/src/pt-binop.cc @@ -279,3 +279,19 @@ { return SET_INTERNAL_VARIABLE (do_braindead_shortcircuit_evaluation); } + +/* + +%!test +%! x = 0; +%! do_braindead_shortcircuit_evaluation (0); +%! if (1 | (x = 1)) +%! endif +%! assert (x, 1); +%! do_braindead_shortcircuit_evaluation (1); +%! if (1 | (x = 0)) +%! endif +%! assert (x, 1); + +*/ +