octave-maintainers
[Top][All Lists]
Advanced

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

Re: regexp test fails


From: David Bateman
Subject: Re: regexp test fails
Date: Sun, 11 Apr 2010 23:36:33 +0200
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Ok, then this is not the right fix for the bug

https://savannah.gnu.org/bugs/?29438

I'll try again to get it right sometime this week

D.


Michael D Godfrey wrote:
It appears that the most recent patch to regexp:
2010-04-09  David Bateman <address@hidden>

    * DLD-FUNCTIONS/regexp.cc (octregexp_list): Properly ignore
    zero-length matches in named tokens.


 causes the failure
[t, nm] = regexp("John Davis\nRogers, James",'(?<first>\w+)\s+(?<last>\w+)|(?<last>\w+),\s+(?<first>\w+)','tokens','names');
 assert (size(t), [1,2]);
 assert (t{1}{1},'John');
 assert (t{1}{2},'Davis');
 assert (t{2}{1},'Rogers');
 assert (t{2}{2},'James');
 assert (size(nm), [1,1]);
 assert (nm.first{1},'John');
 assert (nm.first{2},'James');
 assert (nm.last{1},'Davis');
 assert (nm.last{2},'Rogers');
!!!!! test failed
assert (nm.first {2},'James') expected
James
but got

====================================
t looks correct, but nm.last{2} returns blank.

Anyhow, I get this failure using latest source on:

Linux godfrey-pbdsl3.stanford.edu 2.6.32.11-99.fc12.x86_64 #1 SMP Mon Apr 5 19:59:38 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

Michael




--
David Bateman                                address@hidden
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)



reply via email to

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