octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unexpected textscan error


From: Michael D Godfrey
Subject: Re: unexpected textscan error
Date: Sat, 08 Oct 2011 19:35:52 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 10/08/2011 05:47 PM, Ben Abbott wrote:
On Oct 8, 2011, at 8:23 PM, Ben Abbott wrote:

> I've isolated the problem, and will push a change soon.
> 
> Ben
Changeset is below.

	http://hg.savannah.gnu.org/hgweb/octave/rev/ceda1714a4ad

Ben
After latest patch I see:

octave:1> test strread
  ***** test
 # No delimiters at all besides EOL.  Plain reading numbers & strings
 str = "Text1Text2Text\nText398Text4Text\nText57Text";
 c = textscan (str, "Text%dText%1sText");
 assert (c{1}, int32 ([1; 398; 57]));
 assert (c{2}(1:2), {'2'; '4'});
 assert (isempty (c{2}{3}), true);
!!!!! test failed
some elements undefined in return list
octave:2> test textscan
  ***** test
 str = "Km:10 = hhhBjjj miles16hour\r\n";
 str = [str "Km:15 = hhhJjjj miles241hour\r\n"];
 str = [str "Km:2 = hhhRjjj miles3hour\r\n"];
 str = [str "Km:25 = hhhZ\r\n"];
 fmt = "Km:%d = hhh%1sjjj miles%dhour";
 a = textscan (str, fmt, 'delimiter', ' ');
 assert (a{1}', int32([10 15 2 25]));
 assert (a{2}', {'B' 'J' 'R' 'Z'});
 assert (a{3}', int32([16 241 3 0]));
!!!!! test failed
some elements undefined in return list
octave:3> test substr 
  ***** assert (substr ("This is a test string", 1, 0), "");
!!!!! test failed
assert (substr ("This is a test string", 1, 0),"") expected


but got

octave:4>
=========================
Michael


reply via email to

[Prev in Thread] Current Thread [Next in Thread]