Skip to content

Commit 45d247a

Browse files
fix tests: Test::Needs does not call $module->import
1 parent 031cd39 commit 45d247a

12 files changed

+14
-16
lines changed

t/002_basic_io.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use File::Spec::Functions;
1010
my $dir = tempdir;
1111

1212
use Test::Needs 'JSON::MaybeXS';
13-
diag 'using JSON backend: ', JSON;
13+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1414

1515
plan tests => 9;
1616

t/010_basic_json.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use Test::Needs qw(
88
JSON::MaybeXS
99
Test::Deep::JSON
1010
);
11-
diag 'using JSON backend: ', JSON;
11+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1212

1313
plan tests => 10;
1414

@@ -42,7 +42,7 @@ plan tests => 10;
4242

4343
cmp_deeply(
4444
$json,
45-
json({
45+
Test::Deep::JSON::json({
4646
number => 10,
4747
string => 'foo',
4848
float => 10.5,

t/011_basic_json_w_utf8.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Test::Needs qw(
77
Encode
88
JSON::MaybeXS
99
);
10-
diag 'using JSON backend: ', JSON;
10+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1111

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

t/012_param_json.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ for my $jsonpm (
5858
my $json = eval { Bar->new(x => 10, y => 20)->freeze({ format => $p }) };
5959

6060
cmp_deeply(
61-
decode_json($json),
61+
JSON::MaybeXS->JSON->decode_json($json),
6262
{
6363
'__CLASS__' => 'Bar-0.01',
6464
x => 10,

t/030_with_checksum.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use Test::Needs qw(
99
Digest::HMAC_SHA1
1010
JSON::MaybeXS
1111
);
12-
diag 'using JSON backend: ', JSON;
12+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1313

1414
plan tests => 25;
1515

t/060_basic_deferred.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use Test::Needs qw(
1111
JSON::MaybeXS
1212
YAML::Any
1313
);
14-
diag 'using JSON backend: ', JSON;
14+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1515
diag 'using YAML backend: ', YAML::Any->implementation;
1616

1717
plan tests => 33;
@@ -49,7 +49,7 @@ plan tests => 33;
4949

5050
cmp_deeply(
5151
$json,
52-
json({
52+
Test::Deep::JSON::json({
5353
undef => undef,
5454
number => 10,
5555
string => 'foo',

t/061_basic_deferred_w_io.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use Test::Needs qw(
1212
IO::AtomicFile
1313
JSON::MaybeXS
1414
);
15-
diag 'using JSON backend: ', JSON;
15+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1616

1717
plan tests => 23;
1818

t/100_io.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use File::Spec::Functions;
88
my $dir = tempdir;
99

1010
use Test::Needs 'JSON::MaybeXS';
11-
diag 'using JSON backend: ', JSON;
11+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1212

1313
plan tests => 13;
1414

t/101_io_atomic.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use Test::Needs qw(
1111
JSON::MaybeXS
1212
IO::AtomicFile
1313
);
14-
diag 'using JSON backend: ', JSON;
14+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1515

1616
plan tests => 13;
1717

t/104_io_w_utf8.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use Test::Needs qw(
1010
JSON::MaybeXS
1111
IO::AtomicFile
1212
);
13-
diag 'using JSON backend: ', JSON;
13+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1414

1515
plan tests => 7;
1616

t/105_io_atomic_w_utf8.t

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ use Test::Needs qw(
1010
JSON::MaybeXS
1111
IO::AtomicFile
1212
);
13-
diag 'using JSON backend: ', JSON;
13+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
1414

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

19-
diag 'using JSON backend: ', JSON;
20-
2119
plan tests => 7;
2220

2321
use utf8;

t/300_overloaded.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Test::More 0.88;
44
use Test::Fatal;
55

66
use Test::Needs 'JSON::MaybeXS';
7-
diag 'using JSON backend: ', JSON;
7+
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
88

99
{
1010
package Thing;

0 commit comments

Comments
 (0)