comparison test/io.tst @ 33126:2ff2d201a344

test: Include tests for output message in scanf function (bug #65390, bug #63467). * io.tst: Uncomment out assert statements and enforce test coverage.
author Rik <rik@octave.org>
date Sat, 02 Mar 2024 14:02:19 -0800
parents 9c08824262af
children
comparison
equal deleted inserted replaced
33125:fc467370dacb 33126:2ff2d201a344
669 ## Test space at end of input string 669 ## Test space at end of input string
670 %!test <63467> 670 %!test <63467>
671 %! [val, count, msg, pos] = sscanf ('1 2 ', '%f'); 671 %! [val, count, msg, pos] = sscanf ('1 2 ', '%f');
672 %! assert (val, [1; 2]); 672 %! assert (val, [1; 2]);
673 %! assert (count, 2); 673 %! assert (count, 2);
674 %! ## FIXME: The message should be empty, but is not. 674 %! assert (msg, '');
675 %! # assert (msg, '');
676 %! assert (pos, 5); 675 %! assert (pos, 5);
677 676
678 ## Test newline at end of input string 677 ## Test newline at end of input string
679 %!test <65390> 678 %!test <65390>
680 %! [val, count, msg, pos] = sscanf ("1 2\n", '%f'); 679 %! [val, count, msg, pos] = sscanf ("1 2\n", '%f');
681 %! assert (val, [1; 2]); 680 %! assert (val, [1; 2]);
682 %! assert (count, 2); 681 %! assert (count, 2);
683 %! ## FIXME: The message should be empty, but is not. 682 %! assert (msg, '');
684 %! # assert (msg, '');
685 %! assert (pos, 5); 683 %! assert (pos, 5);
686 684
687 %!test 685 %!test
688 %! [a, b, c] = sscanf ("1.2 3 foo", "%f%d%s", "C"); 686 %! [a, b, c] = sscanf ("1.2 3 foo", "%f%d%s", "C");
689 %! [v1, c1, m1] = sscanf ("1 2 3 4 5 6", "%d"); 687 %! [v1, c1, m1] = sscanf ("1 2 3 4 5 6", "%d");