diff options
author | Eric Wong <e@80x24.org> | 2020-12-15 08:21:24 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-12-19 09:32:08 +0000 |
commit | d42172638f5479f76e73470ad48a679100c3e0d5 (patch) | |
tree | f934fbc068bfc9135fa80d7046c47086a4da4771 /lib | |
parent | 6cdb84af2c75b3c66a35c8c4973f455da15dd0a4 (diff) | |
download | public-inbox-d42172638f5479f76e73470ad48a679100c3e0d5.tar.gz |
We'll probably be using JSON more in the future, so make it easier to require in tests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/ManifestJsGz.pm | 2 | ||||
-rw-r--r-- | lib/PublicInbox/TestCommon.pm | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/ManifestJsGz.pm b/lib/PublicInbox/ManifestJsGz.pm index 6d5b57ee..33df020a 100644 --- a/lib/PublicInbox/ManifestJsGz.pm +++ b/lib/PublicInbox/ManifestJsGz.pm @@ -11,7 +11,7 @@ use PublicInbox::Config; use IO::Compress::Gzip qw(gzip); use HTTP::Date qw(time2str); -our $json = PublicInbox::Config::json(); +my $json = PublicInbox::Config::json(); # called by WwwListing sub url_regexp { diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 299b9c6a..2116575b 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -75,6 +75,10 @@ sub require_mods { my $maybe = pop @mods if $mods[-1] =~ /\A[0-9]+\z/; my @need; while (my $mod = shift(@mods)) { + if ($mod eq 'json') { + $mod = 'Cpanel::JSON::XS||JSON::MaybeXS||'. + 'JSON||JSON::PP' + } if ($mod eq 'Search::Xapian') { if (eval { require PublicInbox::Search } && PublicInbox::Search::load_xapian()) { |