changeset 13041:e5a49b2f8225

codesprint: Single input validation test for beep.m * beep.m: Check number of inputs is correct.
author Rik <octave@nomad.inbox5.com>
date Sat, 03 Sep 2011 07:58:26 -0700
parents 12ba32dd3458
children ca7aaf2689c3
files scripts/io/beep.m
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/io/beep.m	Fri Sep 02 21:48:41 2011 +0100
+++ b/scripts/io/beep.m	Sat Sep 03 07:58:26 2011 -0700
@@ -26,10 +26,13 @@
 
 function beep ()
 
-  if (nargin == 0)
-    puts ("\a");
-  else
+  if (nargin != 0)
     print_usage ();
   endif
 
+  puts ("\a");
+
 endfunction
+
+
+%!error (beep (1))