Skip to content

Commit

Permalink
fix tests: Test::Needs does not call $module->import
Browse files Browse the repository at this point in the history
  • Loading branch information
karenetheridge committed Dec 3, 2018
1 parent 031cd39 commit 45d247a
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion t/002_basic_io.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use File::Spec::Functions;
my $dir = tempdir;

use Test::Needs 'JSON::MaybeXS';
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

plan tests => 9;

Expand Down
4 changes: 2 additions & 2 deletions t/010_basic_json.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Test::Needs qw(
JSON::MaybeXS
Test::Deep::JSON
);
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

plan tests => 10;

Expand Down Expand Up @@ -42,7 +42,7 @@ plan tests => 10;

cmp_deeply(
$json,
json({
Test::Deep::JSON::json({
number => 10,
string => 'foo',
float => 10.5,
Expand Down
2 changes: 1 addition & 1 deletion t/011_basic_json_w_utf8.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use Test::Needs qw(
Encode
JSON::MaybeXS
);
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

binmode $_, ':utf8' foreach map { Test::Builder->new->$_ } qw(output failure_output todo_output);
binmode STDOUT, ':utf8';
Expand Down
2 changes: 1 addition & 1 deletion t/012_param_json.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ for my $jsonpm (
my $json = eval { Bar->new(x => 10, y => 20)->freeze({ format => $p }) };

cmp_deeply(
decode_json($json),
JSON::MaybeXS->JSON->decode_json($json),
{
'__CLASS__' => 'Bar-0.01',
x => 10,
Expand Down
2 changes: 1 addition & 1 deletion t/030_with_checksum.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use Test::Needs qw(
Digest::HMAC_SHA1
JSON::MaybeXS
);
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

plan tests => 25;

Expand Down
4 changes: 2 additions & 2 deletions t/060_basic_deferred.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use Test::Needs qw(
JSON::MaybeXS
YAML::Any
);
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
diag 'using YAML backend: ', YAML::Any->implementation;

plan tests => 33;
Expand Down Expand Up @@ -49,7 +49,7 @@ plan tests => 33;

cmp_deeply(
$json,
json({
Test::Deep::JSON::json({
undef => undef,
number => 10,
string => 'foo',
Expand Down
2 changes: 1 addition & 1 deletion t/061_basic_deferred_w_io.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use Test::Needs qw(
IO::AtomicFile
JSON::MaybeXS
);
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

plan tests => 23;

Expand Down
2 changes: 1 addition & 1 deletion t/100_io.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use File::Spec::Functions;
my $dir = tempdir;

use Test::Needs 'JSON::MaybeXS';
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

plan tests => 13;

Expand Down
2 changes: 1 addition & 1 deletion t/101_io_atomic.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use Test::Needs qw(
JSON::MaybeXS
IO::AtomicFile
);
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

plan tests => 13;

Expand Down
2 changes: 1 addition & 1 deletion t/104_io_w_utf8.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Test::Needs qw(
JSON::MaybeXS
IO::AtomicFile
);
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

plan tests => 7;

Expand Down
4 changes: 1 addition & 3 deletions t/105_io_atomic_w_utf8.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ use Test::Needs qw(
JSON::MaybeXS
IO::AtomicFile
);
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

binmode $_, ':utf8' foreach map { Test::Builder->new->$_ } qw(output failure_output todo_output);
binmode STDOUT, ':utf8';
binmode STDERR, ':utf8';

diag 'using JSON backend: ', JSON;

plan tests => 7;

use utf8;
Expand Down
2 changes: 1 addition & 1 deletion t/300_overloaded.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Test::More 0.88;
use Test::Fatal;

use Test::Needs 'JSON::MaybeXS';
diag 'using JSON backend: ', JSON;
diag 'using JSON backend: ', JSON::MaybeXS->JSON;

{
package Thing;
Expand Down

0 comments on commit 45d247a

Please sign in to comment.