changeset 28564:1dd765e54265

fix tests for new argument number mismatch error message Files affected: help.m, strmatch.m, namedargs2cell.m, camlookat.m, material.m, deblank.m, native2unicode.m, regexptranslate.m, strjust.m, strtrim.m, unicode2native.m, test.m, struct.tst, system.tst
author John W. Eaton <jwe@octave.org>
date Sat, 11 Jul 2020 06:36:31 -0400
parents 5a07c798eb08
children 0ecec070c086
files scripts/help/help.m scripts/legacy/strmatch.m scripts/miscellaneous/namedargs2cell.m scripts/plot/appearance/camlookat.m scripts/plot/appearance/material.m scripts/strings/deblank.m scripts/strings/native2unicode.m scripts/strings/regexptranslate.m scripts/strings/strjust.m scripts/strings/strtrim.m scripts/strings/unicode2native.m scripts/testfun/test.m test/struct.tst test/system.tst
diffstat 14 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/help/help.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/help/help.m	Sat Jul 11 06:36:31 2020 -0400
@@ -224,5 +224,5 @@
 
 ## Test input validation
 %!error <invalid input> help (42)
-%!error <invalid input> help ("abc", "def")
+%!error <called with too many inputs> help ("abc", "def")
 %!error <'_! UNLIKELY_FCN! _' not found> help ("_! UNLIKELY_FCN! _")
--- a/scripts/legacy/strmatch.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/legacy/strmatch.m	Sat Jul 11 06:36:31 2020 -0400
@@ -150,7 +150,7 @@
 ## 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)
+%!error <called with too many inputs> strmatch ("a", "aaa", "exact", 1)
 %!error <S must contain only one string> strmatch ({"a", "b"}, "aaa")
 %!error <S must be a string> strmatch (1, "aaa")
 %!error <S must be a string> strmatch (char ("a", "bb"), "aaa")
--- a/scripts/miscellaneous/namedargs2cell.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/miscellaneous/namedargs2cell.m	Sat Jul 11 06:36:31 2020 -0400
@@ -66,6 +66,6 @@
 
 ## Test input validation
 %!error <Invalid call> namedargs2cell ()
-%!error <Invalid call> namedargs2cell (1, 2)
+%!error <called with too many inputs> namedargs2cell (1, 2)
 %!error <S must be a scalar structure> namedargs2cell (true)
 %!error <S must be a scalar structure> namedargs2cell (struct ("name", {1, 2}))
--- a/scripts/plot/appearance/camlookat.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/plot/appearance/camlookat.m	Sat Jul 11 06:36:31 2020 -0400
@@ -313,7 +313,7 @@
 %! end_unwind_protect
 
 ## Test input validation
-%!error <Invalid call> camlookat (1, 2)
+%!error <called with too many inputs> camlookat (1, 2)
 %!error <must be handle> camlookat ("a")
 %!error <children of the same axes>
 %! hf = figure ("visible", "off");
--- a/scripts/plot/appearance/material.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/plot/appearance/material.m	Sat Jul 11 06:36:31 2020 -0400
@@ -305,7 +305,7 @@
 %!error <Invalid call to material> a = material (-1, 2)
 %!error <Invalid call to material> a = material ({})
 %!error <Invalid call to material> a = material ([.3 .4 .5])
-%!error <Invalid call to material> [a, b] = material ()
+%!error <called with too many outputs> [a, b] = material ()
 %!error <first argument must be a list of handles> material (-1, "metal")
 %!error <unknown material type 'foo'> material foo
 %!error <incorrect number of elements in material vector> material (-1)
--- a/scripts/strings/deblank.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/strings/deblank.m	Sat Jul 11 06:36:31 2020 -0400
@@ -102,5 +102,5 @@
 %!assert (deblank ({" abc   ", {"   def   "}}), {" abc", {"   def"}})
 
 %!error <Invalid call to deblank> deblank ()
-%!error <Invalid call to deblank> deblank ("foo", "bar")
+%!error <called with too many inputs> deblank ("foo", "bar")
 %!error <argument must be a string> deblank (1)
--- a/scripts/strings/native2unicode.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/strings/native2unicode.m	Sat Jul 11 06:36:31 2020 -0400
@@ -93,7 +93,7 @@
 %!        [0 0 120 0 0 123 0 0]);
 
 %!error <Invalid call> native2unicode ()
-%!error <Invalid call> native2unicode (1, 'ISO-8859-1', 'test')
+%!error <called with too many inputs> native2unicode (1, 'ISO-8859-1', 'test')
 %!error <NATIVE_BYTES must be a numeric vector> native2unicode ([1 2; 3 4])
 %!error <NATIVE_BYTES must be a numeric vector> native2unicode ({1 2 3 4})
 %!error <CODEPAGE must be a string> native2unicode (164:170, 123)
--- a/scripts/strings/regexptranslate.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/strings/regexptranslate.m	Sat Jul 11 06:36:31 2020 -0400
@@ -89,6 +89,6 @@
 ## Test input validation
 %!error <Invalid call to regexptranslate> regexptranslate ()
 %!error <Invalid call to regexptranslate> regexptranslate ("wildcard")
-%!error <Invalid call to regexptranslate> regexptranslate ("a", "b", "c")
+%!error <called with too many inputs> regexptranslate ("a", "b", "c")
 %!error <invalid operation> regexptranslate ("foo", "abc")
 %!error <operation OP must be a string> regexptranslate (10, "abc")
--- a/scripts/strings/strjust.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/strings/strjust.m	Sat Jul 11 06:36:31 2020 -0400
@@ -113,6 +113,6 @@
 
 ## Test input validation
 %!error <Invalid call to strjust> strjust ()
-%!error <Invalid call to strjust> strjust (["a";"ab"], "center", 1)
+%!error <called with too many inputs> strjust (["a";"ab"], "center", 1)
 %!error <S must be a string> strjust (ones (3,3))
 %!error <S must be a string> strjust (char (ones (3,3,3)))
--- a/scripts/strings/strtrim.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/strings/strtrim.m	Sat Jul 11 06:36:31 2020 -0400
@@ -90,6 +90,6 @@
 %!assert (strtrim ({" abc   ", {"   def   "}}), {"abc", {"def"}})
 
 %!error <Invalid call to strtrim> strtrim ()
-%!error <Invalid call to strtrim> strtrim ("abc", "def")
+%!error <called with too many inputs> strtrim ("abc", "def")
 %!error <argument must be a string> strtrim (1)
 %!error <argument must be a string> strtrim ({[]})
--- a/scripts/strings/unicode2native.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/strings/unicode2native.m	Sat Jul 11 06:36:31 2020 -0400
@@ -73,7 +73,7 @@
 %!         uint8 ([164:166 0 167:170]));
 
 %!error <Invalid call> unicode2native ()
-%!error <Invalid call> unicode2native ('a', 'ISO-8859-1', 'test')
+%!error <called with too many inputs> unicode2native ('a', 'ISO-8859-1', 'test')
 %!error <UTF8_STR must be a character vector> unicode2native (['ab'; 'cd'])
 %!error <UTF8_STR must be a character vector> unicode2native ({1 2 3 4})
 %!error <CODEPAGE must be a string> unicode2native ('ЄЅІЇЈЉЊ', 123)
--- a/scripts/testfun/test.m	Sat Jul 11 10:15:57 2020 -0400
+++ b/scripts/testfun/test.m	Sat Jul 11 06:36:31 2020 -0400
@@ -940,7 +940,7 @@
 %!fail ("toeplitz ([1,2],[1,2;3,4])", msg2)
 %!fail ("toeplitz ([1,2;3,4],[1,2])", msg2)
 %!test fail ("toeplitz", "Invalid call to toeplitz")
-%!fail ("toeplitz (1, 2, 3)", "Invalid call to toeplitz")
+%!fail ("toeplitz (1, 2, 3)", "called with too many inputs")
 %!test assert (toeplitz ([1,2,3], [1,4]), [1,4; 2,1; 3,2])
 %!assert (toeplitz ([1,2,3], [1,4]), [1,4; 2,1; 3,2])
 %!demo toeplitz ([1,2,3,4],[1,5,6])
@@ -974,7 +974,7 @@
 
 ## Test 'fail' keyword
 %!fail ("test", "Invalid call to test")  # no args, generates usage()
-%!fail ("test (1,2,3,4)", "usage.*test") # too many args, generates usage()
+%!fail ("test (1,2,3,4)", "called with too many inputs") # too many args
 %!fail ('test ("test", "invalid")', "unknown flag")  # incorrect args
 %!fail ('garbage','garbage.*undefined')  # usage on nonexistent function should be
 
--- a/test/struct.tst	Sat Jul 11 10:15:57 2020 -0400
+++ b/test/struct.tst	Sat Jul 11 06:36:31 2020 -0400
@@ -37,7 +37,7 @@
 
 %!test
 %! s.a = 1;
-%! fail ("fieldnames (s, 1)", "Invalid call to fieldnames");
+%! fail ("fieldnames (s, 1)", "called with too many inputs");
 
 %!error fieldnames (1)
 
--- a/test/system.tst	Sat Jul 11 10:15:57 2020 -0400
+++ b/test/system.tst	Sat Jul 11 06:36:31 2020 -0400
@@ -98,7 +98,7 @@
 %! assert ((e1 && strcmp (s2.modestr(1), "d") && e3 && e4 < 0));
 
 %!error <Invalid call to mkdir> mkdir ()
-%!error <Invalid call to mkdir> mkdir ("foo", 1, 2)
+%!error <called with too many inputs> mkdir ("foo", 1, 2)
 %!error <Invalid call to rmdir> rmdir ()
 
 %!test