Mercurial > octave
comparison libinterp/corefcn/file-io.cc @ 21566:02826fb0f261
textscan: Fix bug in exponent parsing
* oct-stream.cc (textscan::read_double): Fix typo in exponent read loop.
* file-io.cc: Add BIST test for exponent parsing.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Wed, 30 Mar 2016 17:28:43 -0700 |
parents | 990c6c31a684 |
children | ecce63c99c3f |
comparison
equal
deleted
inserted
replaced
21565:08baf0ebc9a9 | 21566:02826fb0f261 |
---|---|
2195 %!## Test start of comment as string | 2195 %!## Test start of comment as string |
2196 %! c = textscan ("1 / 2 // 3", "%n %s %u8", "CommentStyle", {"//"}); | 2196 %! c = textscan ("1 / 2 // 3", "%n %s %u8", "CommentStyle", {"//"}); |
2197 %! assert (c, {1, "/", 2}); | 2197 %! assert (c, {1, "/", 2}); |
2198 | 2198 |
2199 %!assert (textscan (["1 2 3 4"; "5 6 7 8"], "%f"), {[15; 26; 37; 48]}) | 2199 %!assert (textscan (["1 2 3 4"; "5 6 7 8"], "%f"), {[15; 26; 37; 48]}) |
2200 | |
2201 %% Check for delimiter after exponent | |
2202 %!assert (textscan ("1e-3|42", "%f", "delimiter", "|"), {[1e-3; 42]}) | |
2200 */ | 2203 */ |
2201 | 2204 |
2202 // These tests have end-comment sequences, so can't just be in a comment | 2205 // These tests have end-comment sequences, so can't just be in a comment |
2203 #if 0 | 2206 #if 0 |
2204 %!test | 2207 %!test |