changeset 11353:cbf58e4b5f4e

Add test for switch statement with otherwise clause, but no cases.
author Rik <octave@nomad.inbox5.com>
date Mon, 13 Dec 2010 18:31:15 -0800
parents 5ea2644b0111
children 7bb759d617e2
files test/ChangeLog test/test_switch.m
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/ChangeLog	Mon Dec 13 21:09:09 2010 -0500
+++ b/test/ChangeLog	Mon Dec 13 18:31:15 2010 -0800
@@ -1,3 +1,8 @@
+2010-12-13  Rik  <octave@nomad.inbox5.com>
+
+	* test_switch.m : Add test for switch statement with otherwise clause,
+	but no cases.
+
 2010-11-10  John W. Eaton  <jwe@octave.org>
 
 	* fntests.m: Set warning state off for Octave:deprecated-functions.
--- a/test/test_switch.m	Mon Dec 13 21:09:09 2010 -0500
+++ b/test/test_switch.m	Mon Dec 13 18:31:15 2010 -0800
@@ -73,6 +73,17 @@
 %! 
 %! assert(all (x == [0, 1, 0, 0]));
 
+%!test
+%! a = 1;
+%!
+%! switch 1
+%! otherwise
+%!   a = 2;
+%! endswitch
+%! 
+%! assert(a == 2);
+
+
 %% test/octave.test/switch/switch-4.m
 %!error <syntax error> eval("switch endswitch");