fix tests: Test::Needs does not call $module->import
Karen Etheridge
5 years ago
9 | 9 |
my $dir = tempdir;
|
10 | 10 |
|
11 | 11 |
use Test::Needs 'JSON::MaybeXS';
|
12 | |
diag 'using JSON backend: ', JSON;
|
|
12 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
13 | 13 |
|
14 | 14 |
plan tests => 9;
|
15 | 15 |
|
7 | 7 |
JSON::MaybeXS
|
8 | 8 |
Test::Deep::JSON
|
9 | 9 |
);
|
10 | |
diag 'using JSON backend: ', JSON;
|
|
10 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
11 | 11 |
|
12 | 12 |
plan tests => 10;
|
13 | 13 |
|
|
41 | 41 |
|
42 | 42 |
cmp_deeply(
|
43 | 43 |
$json,
|
44 | |
json({
|
|
44 |
Test::Deep::JSON::json({
|
45 | 45 |
number => 10,
|
46 | 46 |
string => 'foo',
|
47 | 47 |
float => 10.5,
|
6 | 6 |
Encode
|
7 | 7 |
JSON::MaybeXS
|
8 | 8 |
);
|
9 | |
diag 'using JSON backend: ', JSON;
|
|
9 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
10 | 10 |
|
11 | 11 |
binmode $_, ':utf8' foreach map { Test::Builder->new->$_ } qw(output failure_output todo_output);
|
12 | 12 |
binmode STDOUT, ':utf8';
|
4 | 4 |
use Test::Deep;
|
5 | 5 |
|
6 | 6 |
use Test::Needs qw(MooseX::Storage::Format::JSONpm JSON::MaybeXS);
|
|
7 |
|
|
8 |
JSON::MaybeXS->import;
|
7 | 9 |
|
8 | 10 |
plan tests => 5;
|
9 | 11 |
|
8 | 8 |
Digest::HMAC_SHA1
|
9 | 9 |
JSON::MaybeXS
|
10 | 10 |
);
|
11 | |
diag 'using JSON backend: ', JSON;
|
|
11 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
12 | 12 |
|
13 | 13 |
plan tests => 25;
|
14 | 14 |
|
10 | 10 |
JSON::MaybeXS
|
11 | 11 |
YAML::Any
|
12 | 12 |
);
|
13 | |
diag 'using JSON backend: ', JSON;
|
|
13 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
14 | 14 |
diag 'using YAML backend: ', YAML::Any->implementation;
|
15 | 15 |
|
16 | 16 |
plan tests => 33;
|
|
48 | 48 |
|
49 | 49 |
cmp_deeply(
|
50 | 50 |
$json,
|
51 | |
json({
|
|
51 |
Test::Deep::JSON::json({
|
52 | 52 |
undef => undef,
|
53 | 53 |
number => 10,
|
54 | 54 |
string => 'foo',
|
11 | 11 |
IO::AtomicFile
|
12 | 12 |
JSON::MaybeXS
|
13 | 13 |
);
|
14 | |
diag 'using JSON backend: ', JSON;
|
|
14 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
15 | 15 |
|
16 | 16 |
plan tests => 23;
|
17 | 17 |
|
7 | 7 |
my $dir = tempdir;
|
8 | 8 |
|
9 | 9 |
use Test::Needs 'JSON::MaybeXS';
|
10 | |
diag 'using JSON backend: ', JSON;
|
|
10 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
11 | 11 |
|
12 | 12 |
plan tests => 13;
|
13 | 13 |
|
10 | 10 |
JSON::MaybeXS
|
11 | 11 |
IO::AtomicFile
|
12 | 12 |
);
|
13 | |
diag 'using JSON backend: ', JSON;
|
|
13 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
14 | 14 |
|
15 | 15 |
plan tests => 13;
|
16 | 16 |
|
9 | 9 |
JSON::MaybeXS
|
10 | 10 |
IO::AtomicFile
|
11 | 11 |
);
|
12 | |
diag 'using JSON backend: ', JSON;
|
|
12 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
13 | 13 |
|
14 | 14 |
plan tests => 7;
|
15 | 15 |
|
9 | 9 |
JSON::MaybeXS
|
10 | 10 |
IO::AtomicFile
|
11 | 11 |
);
|
12 | |
diag 'using JSON backend: ', JSON;
|
|
12 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
13 | 13 |
|
14 | 14 |
binmode $_, ':utf8' foreach map { Test::Builder->new->$_ } qw(output failure_output todo_output);
|
15 | 15 |
binmode STDOUT, ':utf8';
|
16 | 16 |
binmode STDERR, ':utf8';
|
17 | |
|
18 | |
diag 'using JSON backend: ', JSON;
|
19 | 17 |
|
20 | 18 |
plan tests => 7;
|
21 | 19 |
|
3 | 3 |
use Test::Fatal;
|
4 | 4 |
|
5 | 5 |
use Test::Needs 'JSON::MaybeXS';
|
6 | |
diag 'using JSON backend: ', JSON;
|
|
6 |
diag 'using JSON backend: ', JSON::MaybeXS->JSON;
|
7 | 7 |
|
8 | 8 |
{
|
9 | 9 |
package Thing;
|