bugGNU Octave - Bugs: bug #31294, test() doesn't find files in...

 
 

bug #31294: test() doesn't find files in packages with classes

Submitted by:  Thomas Weber <tweber>
Submitted on:  Sun 10 Oct 2010 05:55:44 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Thomas WeberOpen/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.

 

Mon 18 Oct 2010 05:21:20 AM UTC, comment #1:

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/a6ab46b5926f

With it, you should be able to do

test @dict/dict

or

test @dict/dict.m

John W. Eaton <jwe>
Project Administrator
Sun 10 Oct 2010 05:55:44 PM UTC, original submission:

Hi,

$ hg tip
changeset: 11095:d4619eb6ef8e
but it also happens on 3.2.4

System: Debian Linux

The way test() checks for the files to test doesn't work when a package uses classes. The following is from the 'general' package. The problem seems to be that test() uses the loadpath to find the function file, but the directory @dict is not added to the loadpath:

octave:1> pkg list
Package Name | Version | Installation directory
--------------+---------+-----------------------
general *| 1.2.2 | /opt/octave/share/octave/packages/general-1.2.2

octave:2> path
.
/opt/octave/libexec/octave/packages/general-1.2.2/x86_64-unknown-linux-gnu-api-v40+
/opt/octave/share/octave/packages/general-1.2.2
/opt/octave/libexec/octave/3.3.52+/site/oct/x86_64-unknown-linux-gnu
<snip>

octave:3> help dict
`dict' is a function from the file /opt/octave/share/octave/packages/general-1.2.2/@dict/dict.m

octave:4> test dict
????? dict does not exist in path

octave:5> cd /opt/octave/share/octave/packages/general-1.2.2/@dict/

octave:6> test dict
error: sq_string cannot be indexed with .
error: evaluating argument list element number 1
error: called from:
error: /opt/octave/share/octave/packages/general-1.2.2/@dict/isempty.m at line 26, column 6
error: /opt/octave/share/octave/3.3.52+/m/testfun/test.m at line 97, column 3

Copying the file into another directory and running it from there works:

octave:2> test dict.m
PASSES 1 out of 1 tests

So, the contenct of dict.m is not to blame.

Thomas Weber <tweber>

 

(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 jwe (Posted a comment)
  • -unavailable- added by tweber (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
    Mon 18 Oct 2010 05:21:20 AM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1