aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/octave/argcargvtest_runme.m
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/octave/argcargvtest_runme.m')
-rw-r--r--Examples/test-suite/octave/argcargvtest_runme.m33
1 files changed, 33 insertions, 0 deletions
diff --git a/Examples/test-suite/octave/argcargvtest_runme.m b/Examples/test-suite/octave/argcargvtest_runme.m
index f246dd9db..d1e4f3a65 100644
--- a/Examples/test-suite/octave/argcargvtest_runme.m
+++ b/Examples/test-suite/octave/argcargvtest_runme.m
@@ -11,9 +11,15 @@ if (mainv(targs,1) != 'hola')
endif
targs={'hi', 'hola'};
+if (mainv(targs,0) != 'hi')
+ error("bad main typemap");
+endif
if (mainv(targs,1) != 'hola')
error("bad main typemap");
endif
+if (mainv(targs,2) != '<<NULL>>')
+ error("bad main typemap");
+endif
try
error_flag = 0;
@@ -27,3 +33,30 @@ endif
initializeApp(largs);
+
+# Check that an empty array works.
+empty_args={};
+if (mainc(empty_args) != 0)
+ error("bad main typemap");
+endif
+if (mainv(empty_args,0) != '<<NULL>>')
+ error("bad main typemap");
+endif
+
+# Check that empty strings are handled.
+empty_string={"hello", blanks(0), "world"};
+if (mainc(empty_string) != 3)
+ error("bad main typemap");
+endif
+if (mainv(empty_string, 0) != "hello")
+ error("bad main typemap");
+endif
+if (mainv(empty_string, 1) != "")
+ error("bad main typemap");
+endif
+if (mainv(empty_string, 2) != "world")
+ error("bad main typemap");
+endif
+if (mainv(empty_string, 3) != "<<NULL>>")
+ error("bad main typemap");
+endif