changeset 20929:45a64a6c7273

fix comment character style in most .m files to be consistent * strread.m, __pltopt__.m, fftshift.m, ifftshift.m, gallery.m, strmatch.m, test.m: Use % as the comment character only for BISTs.
author John W. Eaton <jwe@octave.org>
date Thu, 17 Dec 2015 12:06:30 -0500
parents 2b8447888e0a
children b6ea72a439f8
files scripts/io/strread.m scripts/plot/util/__pltopt__.m scripts/signal/fftshift.m scripts/signal/ifftshift.m scripts/special-matrix/gallery.m scripts/strings/strmatch.m scripts/testfun/test.m
diffstat 7 files changed, 31 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/io/strread.m	Thu Dec 17 11:50:59 2015 -0500
+++ b/scripts/io/strread.m	Thu Dec 17 12:06:30 2015 -0500
@@ -934,14 +934,14 @@
 
 %!test
 %! ## Default format (= %f)
-%1 [a, b, c] = strread ("0.12 0.234 0.3567");
-%1 assert (a, 0.12);
-%1 assert (b, 0.234);
-%1 assert (c, 0.3567);
+%! [a, b, c] = strread ("0.12 0.234 0.3567");
+%! assert (a, 0.12);
+%! assert (b, 0.234);
+%! assert (c, 0.3567);
 
 %!test
 %! [a, b] = strread ("0.41 8.24 3.57 6.24 9.27", "%f%f", 2, "delimiter", " ");
-%1 assert (a, [0.41; 3.57]);
+%! assert (a, [0.41; 3.57]);
 
 %!test
 %! ## TreatAsEmpty
--- a/scripts/plot/util/__pltopt__.m	Thu Dec 17 11:50:59 2015 -0500
+++ b/scripts/plot/util/__pltopt__.m	Thu Dec 17 12:06:30 2015 -0500
@@ -235,7 +235,7 @@
 
 
 ## Only cursory testing.  Real testing done by appearance of plots.
-%test
+%!test
 %! opts = __pltopt__ ("abc", "");
 %! assert (opts.color, []);
 %! assert (opts.linestyle, []);
--- a/scripts/signal/fftshift.m	Thu Dec 17 11:50:59 2015 -0500
+++ b/scripts/signal/fftshift.m	Thu Dec 17 12:06:30 2015 -0500
@@ -147,7 +147,7 @@
 %! assert (y, reshape ([y1 + 2, y1 + 3, y1, y1 + 1], [4 4 4]));
 %! assert (fftshift (y), x);
 
-%% Test input validation
+## Test input validation
 %!error fftshift ()
 %!error fftshift (1, 2, 3)
 %!error fftshift (0:3, -1)
--- a/scripts/signal/ifftshift.m	Thu Dec 17 11:50:59 2015 -0500
+++ b/scripts/signal/ifftshift.m	Thu Dec 17 12:06:30 2015 -0500
@@ -132,7 +132,7 @@
 %! assert (y, reshape ([y1 + 2, y1 + 3, y1, y1 + 1], [4 4 4]));
 %! assert (ifftshift (y), x);
 
-%% Test input validation
+## Test input validation
 %!error ifftshift ()
 %!error ifftshift (1, 2, 3)
 %!error ifftshift (0:3, -1)
--- a/scripts/special-matrix/gallery.m	Thu Dec 17 11:50:59 2015 -0500
+++ b/scripts/special-matrix/gallery.m	Thu Dec 17 12:06:30 2015 -0500
@@ -2902,8 +2902,8 @@
 
 ## BIST testing for just a few functions to verify that the main gallery
 ## dispatch function works.
-%assert (gallery ("clement", 3), [0 1 0; 2 0 2; 0 1 0])
-%assert (gallery ("invhess", 2), [1 -1; 1 2])
+%!assert (gallery ("clement", 3), [0 1 0; 2 0 2; 0 1 0])
+%!assert (gallery ("invhess", 2), [1 -1; 1 2])
 
 ## Test input validation of main dispatch function only
 %!error gallery ()
--- a/scripts/strings/strmatch.m	Thu Dec 17 11:50:59 2015 -0500
+++ b/scripts/strings/strmatch.m	Thu Dec 17 12:06:30 2015 -0500
@@ -111,7 +111,7 @@
 %!assert (strmatch ("", {"", "foo", "bar", ""}), [1, 4])
 %!assert (strmatch ('', { '', '% comment', 'var a = 5', ''}, 'exact'), [1,4])
 
-%% Test input validation
+## Test input validation
 %!error <Invalid call to strmatch> strmatch ()
 %!error <Invalid call to strmatch> strmatch ("a")
 %!error <Invalid call to strmatch> strmatch ("a", "aaa", "exact", 1)
--- a/scripts/testfun/test.m	Thu Dec 17 11:50:59 2015 -0500
+++ b/scripts/testfun/test.m	Thu Dec 17 12:06:30 2015 -0500
@@ -895,24 +895,23 @@
 
 ## All of the following tests should fail.  These tests should
 ## be disabled unless you are developing test() since users don't
-## like to be presented with expected failures.  I use '% !' to disable.
-% !test   error("---------Failure tests.  Use test('test','verbose',1)");
-% !test   assert([a,b,c],[1,3,6]);   # variables have wrong values
-% !invalid                   # unknown block type
-% !error  toeplitz([1,2,3]); # correct usage
-% !test   syntax errors)     # syntax errors fail properly
-% !shared garbage in         # variables must be comma separated
-% !error  syntax++error      # error test fails on syntax errors
-% !error  "succeeds.";       # error test fails if code succeeds
-% !error <wrong pattern> error("message")  # error pattern must match
-% !demo   with syntax error  # syntax errors in demo fail properly
-% !shared a,b,c
-% !demo                      # shared variables not available in demo
-% ! assert (exist ("a", "var"))
-% !error
-% ! test ('/etc/passwd');
-% ! test ("nonexistent file");
-% ! ## These don't signal an error, so the test for an error fails. Note
-% ! ## that the call doesn't reference the current fid (it is unavailable),
-% ! ## so of course the informational message is not printed in the log.
-
+## like to be presented with expected failures.
+## %!test   error("---------Failure tests.  Use test('test','verbose',1)");
+## %!test   assert([a,b,c],[1,3,6]);   # variables have wrong values
+## %!invalid                   # unknown block type
+## %!error  toeplitz([1,2,3]); # correct usage
+## %!test   syntax errors)     # syntax errors fail properly
+## %!shared garbage in         # variables must be comma separated
+## %!error  syntax++error      # error test fails on syntax errors
+## %!error  "succeeds.";       # error test fails if code succeeds
+## %!error <wrong pattern> error("message")  # error pattern must match
+## %!demo   with syntax error  # syntax errors in demo fail properly
+## %!shared a,b,c
+## %!demo                      # shared variables not available in demo
+## %! assert (exist ("a", "var"))
+## %!error
+## %! test ('/etc/passwd');
+## %! test ("nonexistent file");
+## %! ## These don't signal an error, so the test for an error fails. Note
+## %! ## that the call doesn't reference the current fid (it is unavailable),
+## %! ## so of course the informational message is not printed in the log.