changeset 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 8f58f087df7f
children ab6fc7b40541
files src/pt-binop.cc
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/pt-binop.cc	Sat Jul 16 13:06:21 2011 -0700
+++ b/src/pt-binop.cc	Sat Jul 16 13:17:23 2011 -0700
@@ -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);
+
+*/
+