diff libinterp/corefcn/file-io.cc @ 21532:936ab0fca2f7

Textscan returns emptyVal for rows with literal but no conversion (bug #47458) * oct-stream.cc (scan): only skip final line if nothing worked (err & 8) * oct-stream.cc (read_format_once): Record whether anything worked. * file-io.cc: Add built-in self test.
author Lachlan Andrew <lachlanbis@gmail.com>
date Tue, 22 Mar 2016 20:39:16 +1100
parents 2cdbae31c022
children ad0599a0acc6
line wrap: on
line diff
--- a/libinterp/corefcn/file-io.cc	Thu Mar 24 22:31:25 2016 -0700
+++ b/libinterp/corefcn/file-io.cc	Tue Mar 22 20:39:16 2016 +1100
@@ -2123,6 +2123,11 @@
 %! C = textscan ("1 2\t3 4", '%f %[^\t] %f %f');
 %! assert (C, {1, {"2"}, 3, 4});
 
+%% Check a non-empty line with no valid conversion registers empytValue
+%!test
+%! C = textscan ("Empty\n", "Empty%f %f");
+%! assert (C, { NaN, NaN })
+
 %% Check overflow and underflow of integer types
 %!test
 %! a = "-1e90 ";