octave-maintainers
[Top][All Lists]
Advanced

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

Re: unexpected textscan error


From: Ben Abbott
Subject: Re: unexpected textscan error
Date: Sat, 08 Oct 2011 20:23:19 -0400

I've isolated the problem, and will push a change soon.

Ben

On Oct 8, 2011, at 8:21 PM, Michael D Godfrey wrote:

> On 10/08/2011 03:31 PM, Ben Abbott wrote:
>> On Oct 8, 2011, at 6:03 PM, Ben Abbott wrote:
>> 
>> 
>>> > 
>>> I don't know what change may have resulted in this test error, or if it is 
>>> something specific to my build or MacOS.
>>> 
>>> > 
>>> > 
>>> When I run "test strread", I see ...
>>> 
>>> > 
>>> > 
>>> 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
>>> 
>>> > 
>>> > 
>>> Directly from the command line I see ...
>>> 
>>> > 
>>> > 
>>> str = "Text1Text2Text\nText398Text4Text\nText57Text";
>>> 
>>> > 
>>> c = textscan (str, "Text%dText%1sText")
>>> 
>>> > 
>>> error: some elements undefined in return list
>>> 
>>> > 
>>> error: called from:
>>> 
>>> > 
>>> error:   
>>> /Users/bpabbott/Development/mercurial/default/scripts/io/textscan.m at line 
>>> 221, column 11
>>> 
>>> > 
>>> > 
>>> Does anyone else see this?
>>> 
>>> > 
>>> > 
>>> Ben
>>> 
>> Maybe this is also related to the error I see in textscan?
>> 
>> 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
>> 
>> Running Matlab, I see ...
>> 
>> 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', ' ');
>> a{:}
>> 
>> ans = 10
>> 
>> ans =   'B'
>> 
>> ans =  16
>> 
>> 
>> 
> These test worked until:
> octave:1> test strread
> PASSES 17 out of 17 tests
> octave:2> test textscan
> PASSES 13 out of 13 tests
> octave:3> quit
> 
> [qss:octave] hg -v pull
> real URL is http://hg.savannah.gnu.org/hgweb/octave
> pulling from http://www.octave.org/hg/octave
> searching for changes
> adding changesets
> adding manifests
> adding file changes
> added 4 changesets with 6 changes to 6 files
> (run 'hg update' to get a working copy)
> [qss:octave] hg -v update
> resolving manifests
> getting scripts/general/shift.m
> getting scripts/plot/patch.m
> getting scripts/plot/private/__go_draw_axes__.m
> getting scripts/plot/private/__patch__.m
> getting scripts/strings/strtrunc.m
> getting scripts/strings/substr.m
> 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
> =============================================
> 
> Now they all fail.
> 
> Michael
> 



reply via email to

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