jed-users mailing list

[2008 Date Index] [2008 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: problems with upgrade to 0.99.19 (was Re: More patches)


Hallo G.,

"G. Milde" <milde@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On 26.05.08, J�rg Sommer wrote:
>> "G. Milde" <milde@xxxxxxxxxxxxxxxxxxxxx> wrote:
>> > On 25.05.08, J�rg Sommer wrote:
>> >> I've added this patch and now the test exits with the return value 20.
>> > Which means that there are still 20 errors in the test. Could you mail me
>> > the generated testreport.txt?
>
>> 2008-05-25 16:46 Jed 0.99.19-138 (utf8), S-Lang 2.1.3, Emulation 'emacs'
>> test_files in '/usr/share/jed/jed-extra/tests' matching '^[^.].*\.sl$': testing 20 files|dirs 
>>  ch_table-test.sl: 
>>   E: 'Open failed' Unable to load /usr/share/jed/jed-extra/unittest.slc in require() /usr/share/slsh/require.sl
>>  csvutils-test.sl: 
> ...
>> and so on.
>
> It looks like since 0.99.19 the construct 
>
>   -l extra/unittest.sl
>
> corresponding to 
>
>   () = evalfile("extra/unittest.sl");
>   
> does no longer work with the load path
>
>   /usr/share/jed/lib,/usr/share/jed/jed-extra/

No, it works. The problem is your require() call in the test files.

 USAGE
  require (feature [,namespace [,file]])

 DESCRIPTION
  The `require' function ensures that a specified "feature" is present.
  If the feature is not present, the `require' function will attempt to
  load the feature from a file.  If the `namespace' argument is present
  and non-NULL, the specified namespace will be used.  The default is to use
                                                       ^^^^^^^^^^^^^^^^^^^^^
  the current non-anonymous namespace. If called with three arguments, the
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Because you load your test files in a namespace, the feature is looked up
in this namespace and not in the Global namespace or the namespace of the
unittest file. So your provide should put the feature in the Global
namespace and the require should look there or your require should look
in the namespace of the unittest file.

Currently, require looks for the feature unittest in the current
namespace, but doesn't find it and tries to load a file unittest.sl. But
this file isn't in the load path. Putting unittest.sl in the load path
would help, but than you would load the file into each namespace. You
have to call require with the namespace Global.

Schöne Grüße, Jörg.
-- 
“Politics is for the moment, equations are forever”
            (Albert Einstein)

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2008 date index] [2008 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]