Mercurial > octave
diff test/test_io.m @ 13194:3e1871badab9
allow sscanf to accept character arrays with more than one row
* file-io.cc (get_sscanf_data): New function. Flatten character
arrays before extracting character data.
(Fsscanf): Use it.
* test_io.m: New sscanf test.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 19 Sep 2011 16:45:31 -0400 |
parents | 38b52a073cfa |
children | 5fa482628bf6 |
line wrap: on
line diff
--- a/test/test_io.m Thu Sep 22 17:08:49 2011 -0400 +++ b/test/test_io.m Mon Sep 19 16:45:31 2011 -0400 @@ -245,6 +245,8 @@ %!assert (sscanf ('123456', '%10c'), '123456') %!assert (sscanf ('123456', '%10s'), '123456') +%!assert (sscanf (['ab'; 'cd'], '%s'), 'acbd'); + %!test %! [val, count, msg, pos] = sscanf ("3I2", "%f"); %! assert (val, 3);