From fc49a7129d793c0aca2f8450e336bee70acd1b68 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 13 Dec 2021 16:36:26 -0500 Subject: [PATCH] JSON -> JSON::MaybeXS --- t/Controller/Admin/clear-queue-non-current.t | 2 +- t/Controller/Build/cancel.t | 2 +- t/Controller/Build/restart.t | 2 +- t/Controller/JobsetEval/cancel.t | 2 +- t/Controller/JobsetEval/restart.t | 2 +- t/Controller/Root/narinfo.t | 2 +- t/plugins/RunCommand/basic.t | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/t/Controller/Admin/clear-queue-non-current.t b/t/Controller/Admin/clear-queue-non-current.t index 630abbdc..4669fb73 100644 --- a/t/Controller/Admin/clear-queue-non-current.t +++ b/t/Controller/Admin/clear-queue-non-current.t @@ -1,7 +1,7 @@ use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); use File::Copy; my %ctx = test_init( diff --git a/t/Controller/Build/cancel.t b/t/Controller/Build/cancel.t index 5dc5ba8a..b2afc074 100644 --- a/t/Controller/Build/cancel.t +++ b/t/Controller/Build/cancel.t @@ -2,7 +2,7 @@ use feature 'unicode_strings'; use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); my %ctx = test_init(); diff --git a/t/Controller/Build/restart.t b/t/Controller/Build/restart.t index 75904ba4..9a993a11 100644 --- a/t/Controller/Build/restart.t +++ b/t/Controller/Build/restart.t @@ -2,7 +2,7 @@ use feature 'unicode_strings'; use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); my %ctx = test_init(); diff --git a/t/Controller/JobsetEval/cancel.t b/t/Controller/JobsetEval/cancel.t index 03f23e05..5b848117 100644 --- a/t/Controller/JobsetEval/cancel.t +++ b/t/Controller/JobsetEval/cancel.t @@ -2,7 +2,7 @@ use feature 'unicode_strings'; use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); my %ctx = test_init(); diff --git a/t/Controller/JobsetEval/restart.t b/t/Controller/JobsetEval/restart.t index c5957cf7..30581987 100644 --- a/t/Controller/JobsetEval/restart.t +++ b/t/Controller/JobsetEval/restart.t @@ -2,7 +2,7 @@ use feature 'unicode_strings'; use strict; use warnings; use Setup; -use JSON qw(decode_json encode_json); +use JSON::MaybeXS qw(decode_json encode_json); my %ctx = test_init(); diff --git a/t/Controller/Root/narinfo.t b/t/Controller/Root/narinfo.t index 297d336b..0a473a03 100644 --- a/t/Controller/Root/narinfo.t +++ b/t/Controller/Root/narinfo.t @@ -2,7 +2,7 @@ use strict; use warnings; use Setup; use Data::Dumper; -use JSON qw(decode_json); +use JSON::MaybeXS qw(decode_json); my %ctx = test_init( # Without this, the test will fail because a `file:` store is not treated as a # local store by `isLocalStore` in src/lib/Hydra/Helper/Nix.pm, and any diff --git a/t/plugins/RunCommand/basic.t b/t/plugins/RunCommand/basic.t index 4771e6af..0dfcd79d 100644 --- a/t/plugins/RunCommand/basic.t +++ b/t/plugins/RunCommand/basic.t @@ -1,7 +1,7 @@ use feature 'unicode_strings'; use strict; use warnings; -use JSON; +use JSON::MaybeXS; use Setup; my %ctx = test_init( @@ -42,7 +42,7 @@ my $dat = do { open(my $json_fh, "<", $filename) or die("Can't open \"$filename\": $!\n"); local $/; - my $json = JSON->new; + my $json = JSON::MaybeXS->new; $json->decode(<$json_fh>) };