Skip to content

Commit

Permalink
The converted tests (not tested at all)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannk committed Oct 22, 2009
1 parent 4baff47 commit b16f9f9
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 34 deletions.
3 changes: 2 additions & 1 deletion t/02-use.t
Expand Up @@ -3,7 +3,8 @@ use Test::More tests => 3;

require 't/testutils.pl';

use Find::Lib 'mylib', 'MyLib';
use Find::Lib 'mylib';
use MyLib;

ok my $path = $INC{ 'MyLib.pm' }, "MyLib used";
like $path, qr/mylib/, "just to be sure :)";
9 changes: 0 additions & 9 deletions t/04-import.t

This file was deleted.

12 changes: 0 additions & 12 deletions t/05-complex.t

This file was deleted.

3 changes: 2 additions & 1 deletion t/07-libs.t
Expand Up @@ -3,5 +3,6 @@ use Test::More tests => 2;

require 't/testutils.pl';

use Find::Lib 'libs', 'Foo', a => 1, b => 42;
use Find::Lib 'libs'
use Foo a => 1, b => 42;
in_inc( 'libs' );
2 changes: 1 addition & 1 deletion t/08-dupe-slashes.t
Expand Up @@ -3,5 +3,5 @@ use Test::More tests => 2;

require 't/testutils.pl';

use Find::Lib './///libs', 'Foo', a => 1, b => 42;
use Find::Lib './///libs';
in_inc( 'libs' );
6 changes: 2 additions & 4 deletions t/moretests/01-relative.t
@@ -1,10 +1,8 @@
use strict;
use Test::More tests => 3;

use Find::Lib libs => [ '../mylib', 'mytestlib' ],
pkgs => { MyLib => [ a => 1, b => 42+42 ],
'Test::More' => [],
};
use Find::Lib '../mylib', 'mytestlib',
use MyLib a => 1, b => 42+42;

ok $MyLib::imported{'a'};
is $MyLib::imported{'b'}, 84;
3 changes: 2 additions & 1 deletion t/moretests/02-dollar0-begin.t
Expand Up @@ -6,7 +6,8 @@ BEGIN { $0 = "[ren/am/med]" };

use Find::Lib;
eval {
Find::Lib->import('../mylib', 'MyLib', a => 1, b => 42);
Find::Lib->import('../mylib');
use MyLib a => 1, b => 42;
};
chomp $@;
ok $@, "we die if \$0 ($0) doesn't make sense";
Expand Down
3 changes: 2 additions & 1 deletion t/moretests/02-dollar0.t
Expand Up @@ -2,7 +2,8 @@ use strict;
use Test::More tests => 3;

$0 = "Renammed";
use Find::Lib '../mylib', 'MyLib', a => 1, b => 42;
use Find::Lib '../mylib';
use MyLib a => 1, b => 42;

ok $MyLib::imported{'a'};
is $MyLib::imported{'b'}, 42;
Expand Down
3 changes: 2 additions & 1 deletion t/moretests/03-chdir-begin.t
Expand Up @@ -6,7 +6,8 @@ use Find::Lib;
BEGIN { chdir '/tmp' };

eval {
Find::Lib->import('../mylib', 'MyLib', a => 1, b => 42);
Find::Lib->import('../mylib');
use MyLib a => 1, b => 42;
};
ok ! $@, "we didn't die, because initial Find::Lib compilation saved cwd";

3 changes: 2 additions & 1 deletion t/moretests/03-chdir-topbegin.t
Expand Up @@ -6,6 +6,7 @@ BEGIN { chdir '/tmp' };
use Find::Lib;

eval {
Find::Lib->import('../mylib', 'MyLib', a => 1, b => 42);
Find::Lib->import('../mylib');
use MyLib a => 1, b => 42;
};
ok !$@, "we didn't die because chdir doesn't change PWD, so we are safe";
3 changes: 2 additions & 1 deletion t/moretests/03-chdir.t
Expand Up @@ -3,7 +3,8 @@ use Test::More tests => 3;

chdir "/";

use Find::Lib '../mylib', 'MyLib', a => 1, b => 42;
use Find::Lib '../mylib';
use MyLib a => 1, b => 42;

ok $MyLib::imported{'a'};
is $MyLib::imported{'b'}, 42;
Expand Down
9 changes: 9 additions & 0 deletions t/moretests/05-backcompat.t
@@ -0,0 +1,9 @@
use strict;
use Test::More tests => 3;

use Find::Lib libs => [ '../mylib', 'mytestlib'];
use MyLib a => 1, b => 42+42;

ok $MyLib::imported{'a'};
is $MyLib::imported{'b'}, 84;

11 changes: 11 additions & 0 deletions t/moretests/06-conflict.t
@@ -0,0 +1,11 @@
use strict;
use Test::More tests => 3;

## this is potentially conflicting with backward
## except that we're smart enough to detect it
use Find::Lib 'libs', '../mylib', 'mytestlib';
use MyLib a => 1, b => 42+42;

ok $MyLib::imported{'a'};
is $MyLib::imported{'b'}, 84;

3 changes: 2 additions & 1 deletion t/moretests/symlink_test.pl
Expand Up @@ -2,5 +2,6 @@
## this is not a test in itself, don't execute
## this is a script that is executed by a test

use Find::Lib '../t/mylib', 'MyLibNoTest';
use Find::Lib '../t/mylib';
use MyLibNoTest;
exit 0;

0 comments on commit b16f9f9

Please sign in to comment.