Skip to content

Commit

Permalink
Update tests to work with @inc that does not contain '.'
Browse files Browse the repository at this point in the history
Bug report: https://rt.cpan.org/Ticket/Display.html?id=121458

Perl 5.25.11 removes '.' from the default @inc, and this breaks
`require "test_data/gen_test_data.pl"` due to not being able to assume
./test_data/gen_test_data.pl is in the @inc load path, and due to
`require` treating paths without leading "/" or "./" as search paths.

This change implements the first solution suggested by the reporter of
the bug: Re-organise test dependencies into a dedicated directory such
as `t/lib` and load that path into @inc with `use lib 't/lib'`.
  • Loading branch information
vandry committed May 28, 2017
1 parent f2db8ca commit bf143b9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion t/frconvert.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env perl -w
use strict;
use Test;
use lib 't/lib';
BEGIN { plan tests => 1 }
require "test_data/gen_test_data.pl";
require "gen_test_data.pl";

gen("foo");
use Locale::gettext;
Expand Down
3 changes: 2 additions & 1 deletion t/jaconvert.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env perl -w
use strict;
use Test;
use lib 't/lib';
BEGIN { plan tests => 1 }
require "test_data/gen_test_data.pl";
require "gen_test_data.pl";

gen("jaeuc");
use Locale::gettext;
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion t/raw.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env perl -w
use strict;
use Test;
use lib 't/lib';
BEGIN { plan tests => 1 }
require "test_data/gen_test_data.pl";
require "gen_test_data.pl";

gen("foo");
use Locale::gettext;
Expand Down

0 comments on commit bf143b9

Please sign in to comment.