diff test/io.tst @ 27137:30f53f7a7293

Return correct error messages on octave-streams when scanf fails (bug #56396) * file-io.cc (Fsscanf): Add BIST test for bug #56396. * oct-stream.cc (base_stream::do_scanf): Perform end-of-scan processing if EOF has been detected, not just when FAILBIT has been set. If FAILBIT has been set, call error() to set an error message on the octave-stream. At end of function, assign any partial results obtained to output. Don't require that all conversions were successful. * io.tst: Update BIST tests to reflect new Matlab-compatible behavior for error message output.
author Rik <rik@octave.org>
date Mon, 03 Jun 2019 09:04:41 -0700
parents dfd0a2cdb621
children b442ec6dda5c
line wrap: on
line diff
--- a/test/io.tst	Sat Jun 01 21:01:45 2019 -0700
+++ b/test/io.tst	Mon Jun 03 09:04:41 2019 -0700
@@ -336,7 +336,7 @@
 %! [val, count, msg, pos] = sscanf ("3I2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
-%! assert (msg, "");
+%! assert (msg, "sscanf: format failed to match");
 %! assert (pos, 2);
 
 %!xtest <47413>
@@ -345,14 +345,14 @@
 %! [val, count, msg, pos] = sscanf ("3I2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
-%! assert (msg, "");
+%! assert (msg, "sscanf: format failed to match");
 %! assert (pos, 2);
 
 %!testif ; ! ismac ()
 %! [val, count, msg, pos] = sscanf ("3In2", "%f");
 %! assert (val, 3);
 %! assert (count, 1);
-%! assert (msg, "");
+%! assert (msg, "sscanf: format failed to match");
 %! assert (pos, 2);
 
 %!xtest <47413>