# HG changeset patch # User Rik # Date 1310847443 25200 # Node ID 46e0d66596f2c31e2af9f309ae5e75bc4a12ca3c # Parent 8f58f087df7f2587e15cd01ec1d47ddcc3a3fbc5 codesprint: Add test for do_braindead_shortcircuit_evaluation * pt-binop.cc: Add test for do_braindead_shortcircuit_evaluation diff --git a/src/pt-binop.cc b/src/pt-binop.cc --- 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); + +*/ +