changeset 31172:e8a46f801825 stable

io.tst: Add test case for scanf (bug #62723). * test/io.tst: Add test case for sscanf that reaches the end of stream with a pattern that matches characters.
author Markus Mützel <markus.muetzel@gmx.de>
date Wed, 03 Aug 2022 19:00:08 +0200
parents bcd75c07c9e8
children 06dc7fe25322 fb1c7c8a030b
files test/io.tst
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/io.tst	Tue Aug 02 18:46:24 2022 +0200
+++ b/test/io.tst	Wed Aug 03 19:00:08 2022 +0200
@@ -387,6 +387,13 @@
 %! assert (msg, "");
 %! assert (pos, 6);
 
+%!test <*62723>
+%! [val, count, msg, pos] = sscanf ("p", "%c");
+%! assert (val, "p");
+%! assert (count, 1);
+%! assert (msg, "");
+%! assert (pos, 2);
+
 %!test
 %! [a, b, c] = sscanf ("1.2 3 foo", "%f%d%s", "C");
 %! [v1, c1, m1] = sscanf ("1 2 3 4 5 6", "%d");