bugGNU Octave - Bugs: bug #37555, strsplit.m fails a test; fix...

 
 

bug #37555: strsplit.m fails a test; fix proposed.

Submitter:  Arun Giridhar <arungiridhar>
Submitted:  Fri 12 Oct 2012 12:34:44 AM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 12 Oct 2012 12:36:06 PM UTC, comment #1: 

Duplicate of bug #37535. If you are interested in Octave development, I recommend you subscribe to the bug list so you can be notified by email of bug activity:

https://savannah.gnu.org/mail/?group=octave

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Fri 12 Oct 2012 12:34:44 AM UTC, original submission:  

Data: Ubuntu 12.04 32bit on Intel Core i5, using Octave dev sources.

The function octave/scripts/strings/strsplit.m fails a test during "make check". I'm not sure why this cropped up suddenly today. Here's the output from test/fntests.log:

  *** assert (strsplit (["a,bc";",de"], ","), {"a", "bc", ones(1,0), "de "})
!!!!! test failed
assert (strsplit (["a,bc"; ",de"], ","),{"a", "bc", ones(1, 0), "de "}) expected
{
  [1,1] = a
  [1,2] = bc
  [1,3] = [](1x0)
  [1,4] = de
}
but got
{
  [1,1] = a
  [1,2] = bc
  [1,3] =
  [1,4] = de
}

It turns out that strsplit is returning a 1x0 character array, which doesn't equate to the 1x0 numeric array specified in the assertion.

Fix: I eliminated the test error by changing "ones(1,0)" to "char(ones(1,0))" in the assert statement. Alternatively "repmat(' ',1,0)" also works. Changing the test to make the RHS be a 1x0 character array in any manner fixes the test. My actual code that uses strsplit is unaffected by the bug.

Arun Giridhar <arungiridhar>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by arungiridhar (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-10-12 jordigh StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code