On Sat 28 Sep 2002 03:25, Michael G Schwern <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 24, 2002 at 05:57:41PM +0200, H.Merijn Brand wrote:
> > 1. use_ok should have an entry in the manual for minimal version
> > 
> >     use_ok ("Test::More", 0.47);
> 
> This currently doesn't work quite right.  Observe...

use_ok ("Test::More");
is ($Test::More::VERSION, 0.47, "Test::More version check");

ain't quite the same either. Some of my tests indeed *require* a certain
version of some::module. Someting to add to Test::More?

> $ perl -MTest::More -wle 'plan tests => 1;  use_ok("Text::Soundex", 0.20)'
> 1..1
> not ok 1 - use Text::Soundex;
> #     Failed test (-e at line 1)
> #     Tried to use 'Text::Soundex'.
> #     Error:  Import directive '0.2' was not recognized at (eval 1) line 3
> # Looks like you failed 1 tests of 1.
> 
> The trouble is use_ok does this:
> 
>     require "Text::Soundex";
>     Text::Soundex->import(0.20);
> 
> this is different than "use Text::Soundex 0.20".  In the latter, Perl
> handles the version check itself.  But in the former, Text::Soundex's import
> routine does the work.  Normally, Exporter will emulate the version check
> but if you're not using Exporter, as Text::Soundex does not, anything could
> happen.
> 
> For similar reasons, Test::More can't check itself.
> 
> $ perl -MTest::More -wle 'plan tests => 1;  use_ok("Test::More", 0.40)'
> 1..1
> not ok 1 - use Test::More;
> #     Failed test (-e at line 1)
> #     Tried to use 'Test::More'.
> #     Error:  You tried to plan twice!  Second plan at (eval 1) line 3
> # Looks like you failed 1 tests of 1.
> schwern@blackrider:~/src/devel/Test-Simple$ 
> 
> 
> I'll have to put in some special case code to make it work right.
> 
> 
> > 2. I'm testing conversions to and from Unicode
> 
> Unicode... wasn't he the bad guy in the Transformers Movie?

\N{INVERTED QUESTION MARK LEFT}

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0 & 633 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
  WinNT 4, Win2K pro & WinCE 2.11.  Smoking perl CORE: [EMAIL PROTECTED]
http:[EMAIL PROTECTED]/   [EMAIL PROTECTED]
send smoke reports to: [EMAIL PROTECTED], QA: http://qa.perl.org


Reply via email to