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

 
 

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

Submitted by:  Arun Giridhar <arungiridhar>
Submitted on:  Fri 12 Oct 2012 12:34:44 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: DuplicateAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Administrator
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>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 12 Oct 2012 12:36:06 PM UTCjordighStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1