[Top][All Lists]

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

regexp test fails

From: Michael D Godfrey
Subject: regexp test fails
Date: Sun, 11 Apr 2010 13:48:41 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

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
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 #1 SMP Mon Apr 5 19:59:38 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux


reply via email to

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