diff --git a/Build.PL b/Build.PL index 267b845..dd679c6 100644 --- a/Build.PL +++ b/Build.PL @@ -66,11 +66,10 @@ my $build = $class->new dist_author => 'Mark A. Jensen', license => 'perl', requires => { - 'JSON' => 2.0, - 'JSON::XS' => 2.0, - 'JSON::ize' => 0.202, + 'JSON::MaybeXS' => '1.003003', 'HOP::Stream' => 0, 'URI::Escape' => 3.3, + 'HTTP::Tiny' => 0, 'LWP::UserAgent' => 6.04, 'LWP::Protocol::https' => 6.06, 'Exception::Class' => 1.3, @@ -95,7 +94,6 @@ my $build = $class->new 'Test::NoWarnings' => 0, 'Mock::Quick' => 0, 'List::MoreUtils' => 0, - 'Mojo::Exception' => 0, 'Neo4j::Driver' => '0.26', # cypher_params v2 experimental => 0, 'IPC::Run' => 0, @@ -104,6 +102,7 @@ my $build = $class->new }, build_recommends => { 'Test::Pod' => 1.0, + #'Mojo::Exception' => 0, 'Mojo::UserAgent' => 0, 'HTTP::Thin' => 0, }, diff --git a/Changes b/Changes index b0c9c98..fd73469 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Perl module REST::Neo4p +0.4011 DEVELOPMENT + - Drop dependencies on JSON, JSON::XS, JSON::ize + - Avoid deprecation warnings for smartmatch on Perl v5.38 and v5.40 + - Fix test suite failing on old Perl versions + 0.4010 NOT RELEASED - Fix an issue that prevented the use of the Bolt protocol with REST::Neo4p via Neo4j::Driver 1.02 or newer diff --git a/lib/REST/Neo4p.pm b/lib/REST/Neo4p.pm index 46f5c8c..ce19e61 100644 --- a/lib/REST/Neo4p.pm +++ b/lib/REST/Neo4p.pm @@ -2,11 +2,10 @@ use v5.10; package REST::Neo4p; use Carp qw(croak carp); use lib '../../lib'; -use JSON; +use JSON::MaybeXS (); use URI; use URI::Escape; use HTTP::Tiny; -use JSON::ize; use Neo4j::Driver 0.26; use REST::Neo4p::Agent; use REST::Neo4p::Node; @@ -17,7 +16,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::VERSION = '0.4010'; + $REST::Neo4p::VERSION = '0.4011'; } our $CREATE_AUTO_ACCESSORS = 0; @@ -25,7 +24,7 @@ our @HANDLES; our $HANDLE = 0; our $AGENT_MODULE = $ENV{REST_NEO4P_AGENT_MODULE} || 'LWP::UserAgent'; -my $json = JSON->new->allow_nonref(1)->utf8; +my $json = JSON::MaybeXS->new->allow_nonref(1)->utf8; $HANDLES[0]->{_q_endpoint} = 'cypher'; diff --git a/lib/REST/Neo4p/Agent.pm b/lib/REST/Neo4p/Agent.pm index e73bf22..6ea2f44 100644 --- a/lib/REST/Neo4p/Agent.pm +++ b/lib/REST/Neo4p/Agent.pm @@ -1,7 +1,7 @@ use v5.10; package REST::Neo4p::Agent; use REST::Neo4p::Exceptions; -use JSON; +use JSON::MaybeXS (); use File::Temp; use Carp qw(croak carp); use strict; @@ -10,12 +10,12 @@ use warnings; our @ISA; our $VERSION; BEGIN { - $REST::Neo4p::Agent::VERSION = '0.4010'; + $REST::Neo4p::Agent::VERSION = '0.4011'; } our $AUTOLOAD; our $JOB_CHUNK = 1024; -our $JSON = JSON->new()->allow_nonref(1)->utf8; +our $JSON = JSON::MaybeXS->new()->allow_nonref(1)->utf8; our $RQ_RETRIES = 3; our $RETRY_WAIT = 5; sub new { @@ -208,6 +208,7 @@ sub AUTOLOAD { sub __do_request { my $self = shift; my ($rq, $action, @args) = @_; + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental qw/smartmatch/; $self->{_errmsg} = $self->{_location} = $self->{_raw_response} = $self->{_decoded_content} = undef; my $resp; diff --git a/lib/REST/Neo4p/Agent/HTTP/Thin.pm b/lib/REST/Neo4p/Agent/HTTP/Thin.pm index dea2cc6..cbe80cd 100644 --- a/lib/REST/Neo4p/Agent/HTTP/Thin.pm +++ b/lib/REST/Neo4p/Agent/HTTP/Thin.pm @@ -9,7 +9,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Agent::HTTP::Thin::VERSION = '0.4010'; + $REST::Neo4p::Agent::HTTP::Thin::VERSION = '0.4011'; } my $unsafe = "^A-Za-z0-9\-\._~:+?%&="; @@ -56,6 +56,7 @@ sub post { shift->_do('POST',@_) } sub _do { my $self = shift; my ($rq, $url, @args) = @_; + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental qw/smartmatch/; # if (length($self->{_user}) && length($self->{_pwd})) { # $url =~ s|(https?://)|${1}$$self{_user}:$$self{_pwd}@|; diff --git a/lib/REST/Neo4p/Agent/LWP/UserAgent.pm b/lib/REST/Neo4p/Agent/LWP/UserAgent.pm index 2008413..502b577 100644 --- a/lib/REST/Neo4p/Agent/LWP/UserAgent.pm +++ b/lib/REST/Neo4p/Agent/LWP/UserAgent.pm @@ -6,7 +6,7 @@ use LWP::ConnCache; use strict; use warnings; BEGIN { - $REST::Neo4p::Agent::LWP::UserAgent::VERSION = '0.4010'; + $REST::Neo4p::Agent::LWP::UserAgent::VERSION = '0.4011'; } sub new { my ($class,@args) = @_; diff --git a/lib/REST/Neo4p/Agent/Mojo/UserAgent.pm b/lib/REST/Neo4p/Agent/Mojo/UserAgent.pm index 239e3c6..1873176 100644 --- a/lib/REST/Neo4p/Agent/Mojo/UserAgent.pm +++ b/lib/REST/Neo4p/Agent/Mojo/UserAgent.pm @@ -9,7 +9,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Agent::Mojo::UserAgent::VERSION = '0.4010'; + $REST::Neo4p::Agent::Mojo::UserAgent::VERSION = '0.4011'; } our @default_headers; @@ -89,6 +89,7 @@ sub post { shift->_do('POST',@_) } sub _do { my $self = shift; my ($rq, $url, @args) = @_; + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental qw/smartmatch/; my ($tx, $content, $content_file); # neo4j wants to redirect .../data to .../data/ diff --git a/lib/REST/Neo4p/Agent/Neo4j/Driver.pm b/lib/REST/Neo4p/Agent/Neo4j/Driver.pm index 3725a0a..0d4a866 100644 --- a/lib/REST/Neo4p/Agent/Neo4j/Driver.pm +++ b/lib/REST/Neo4p/Agent/Neo4j/Driver.pm @@ -3,7 +3,6 @@ use v5.10; use lib '../../../../../lib'; # testing use base qw/REST::Neo4p::Agent/; use Neo4j::Driver 0.26; -use JSON::ize; use REST::Neo4p::Agent::Neo4j::DriverActions; use REST::Neo4p::Exceptions; use Try::Tiny; @@ -14,7 +13,7 @@ use HTTP::Response; use strict; use warnings; BEGIN { - $REST::Neo4p::Agent::Neo4j::Driver::VERSION = '0.4010'; + $REST::Neo4p::Agent::Neo4j::Driver::VERSION = '0.4011'; } my $WARN_ON_ERROR; diff --git a/lib/REST/Neo4p/Batch.pm b/lib/REST/Neo4p/Batch.pm index 08738eb..5ae3296 100644 --- a/lib/REST/Neo4p/Batch.pm +++ b/lib/REST/Neo4p/Batch.pm @@ -2,7 +2,7 @@ use v5.10.1; package REST::Neo4p::Batch; use REST::Neo4p::Exceptions; -use JSON::XS; +use JSON::MaybeXS (); use REST::Neo4p::ParseStream; use HOP::Stream qw/drop head/; require REST::Neo4p; @@ -13,7 +13,7 @@ use warnings; no warnings qw(once); BEGIN { - $REST::Neo4p::Batch::VERSION = '0.4010'; + $REST::Neo4p::Batch::VERSION = '0.4011'; } our @EXPORT = qw(batch); @@ -33,7 +33,7 @@ sub batch (&@) { $agent->batch_mode(1); $coderef->(); my $tmpfh = $agent->execute_batch_chunk; - my $jsonr = JSON::XS->new->utf8; + my $jsonr = JSON::MaybeXS->new->utf8; my $buf; $tmpfh->read($buf, $BUFSIZE); $jsonr->incr_parse($buf); @@ -41,6 +41,7 @@ sub batch (&@) { die "j_parse: expecting BATCH stream" unless ($res->[0] eq 'BATCH'); my $str = $res->[1]->(); while (my $obj = drop($str)) { + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental qw/smartmatch/; $obj = $obj->[1]; given ($obj) { diff --git a/lib/REST/Neo4p/Constrain.pm b/lib/REST/Neo4p/Constrain.pm index e070a5f..75289ec 100644 --- a/lib/REST/Neo4p/Constrain.pm +++ b/lib/REST/Neo4p/Constrain.pm @@ -12,7 +12,7 @@ no warnings qw(once redefine); BEGIN { - $REST::Neo4p::Constrain::VERSION = '0.4010'; + $REST::Neo4p::Constrain::VERSION = '0.4011'; } our @EXPORT = qw(create_constraint drop_constraint constrain relax); our @VALIDATE = qw(validate_properties validate_relationship validate_relationship_type); diff --git a/lib/REST/Neo4p/Constraint.pm b/lib/REST/Neo4p/Constraint.pm index b94948b..f5757dc 100644 --- a/lib/REST/Neo4p/Constraint.pm +++ b/lib/REST/Neo4p/Constraint.pm @@ -3,7 +3,7 @@ package REST::Neo4p::Constraint; use base 'Exporter'; use REST::Neo4p; use REST::Neo4p::Exceptions; -use JSON; +use JSON::MaybeXS qw(decode_json); use Data::Dumper; use Scalar::Util qw(looks_like_number); @@ -19,7 +19,7 @@ our %EXPORT_TAGS = ( all => [@EXPORT,@EXPORT_OK] ); -our $jobj = JSON->new->utf8; +our $jobj = JSON::MaybeXS->new->utf8; $jobj->allow_blessed(1); $jobj->convert_blessed(1); my $regex_to_json = sub { @@ -31,7 +31,7 @@ my $regex_to_json = sub { }; BEGIN { - $REST::Neo4p::Constraint::VERSION = '0.4010'; + $REST::Neo4p::Constraint::VERSION = '0.4011'; } # valid constraint types diff --git a/lib/REST/Neo4p/Constraint/Property.pm b/lib/REST/Neo4p/Constraint/Property.pm index 3bb7b32..8bd6cc5 100644 --- a/lib/REST/Neo4p/Constraint/Property.pm +++ b/lib/REST/Neo4p/Constraint/Property.pm @@ -5,7 +5,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Constraint::Property::VERSION = '0.4010'; + $REST::Neo4p::Constraint::Property::VERSION = '0.4011'; } sub new_from_constraint_hash { @@ -189,7 +189,7 @@ use base 'REST::Neo4p::Constraint::Property'; use strict; use warnings; BEGIN { - $REST::Neo4p::Constraint::NodeProperty::VERSION='0.4010'; + $REST::Neo4p::Constraint::NodeProperty::VERSION='0.4011'; } sub new { @@ -216,7 +216,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Constraint::RelationshipProperty::VERSION='0.4010'; + $REST::Neo4p::Constraint::RelationshipProperty::VERSION='0.4011'; } # relationship_type is added as a pseudoproperty diff --git a/lib/REST/Neo4p/Constraint/Relationship.pm b/lib/REST/Neo4p/Constraint/Relationship.pm index 9821e61..5dd28ca 100644 --- a/lib/REST/Neo4p/Constraint/Relationship.pm +++ b/lib/REST/Neo4p/Constraint/Relationship.pm @@ -5,7 +5,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Constraint::Relationship::VERSION = '0.4010'; + $REST::Neo4p::Constraint::Relationship::VERSION = '0.4011'; } sub new { diff --git a/lib/REST/Neo4p/Constraint/RelationshipType.pm b/lib/REST/Neo4p/Constraint/RelationshipType.pm index e2688f3..a7453f4 100644 --- a/lib/REST/Neo4p/Constraint/RelationshipType.pm +++ b/lib/REST/Neo4p/Constraint/RelationshipType.pm @@ -5,7 +5,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Constraint::RelationshipType::VERSION = '0.4010'; + $REST::Neo4p::Constraint::RelationshipType::VERSION = '0.4011'; } sub new { diff --git a/lib/REST/Neo4p/Entity.pm b/lib/REST/Neo4p/Entity.pm index c160d0f..eeb31dc 100644 --- a/lib/REST/Neo4p/Entity.pm +++ b/lib/REST/Neo4p/Entity.pm @@ -3,7 +3,6 @@ use v5.10; package REST::Neo4p::Entity; use REST::Neo4p::Exceptions; use Carp qw(croak carp); -use JSON; use Scalar::Util qw(blessed); use URI::Escape; use strict; @@ -11,7 +10,7 @@ use warnings; # base class for nodes, relationships, indexes... BEGIN { - $REST::Neo4p::Entity::VERSION = '0.4010'; + $REST::Neo4p::Entity::VERSION = '0.4011'; } our $ENTITY_TABLE = {}; @@ -465,7 +464,7 @@ use strict; use warnings; no warnings qw/once/; BEGIN { - $REST::Neo4p::Simple::VERSION = '0.4010'; + $REST::Neo4p::Simple::VERSION = '0.4011'; } sub new { $_[1] } diff --git a/lib/REST/Neo4p/Exceptions.pm b/lib/REST/Neo4p/Exceptions.pm index 8889c03..a4f1670 100644 --- a/lib/REST/Neo4p/Exceptions.pm +++ b/lib/REST/Neo4p/Exceptions.pm @@ -4,7 +4,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Exceptions::VERSION = '0.4010'; + $REST::Neo4p::Exceptions::VERSION = '0.4011'; } use Exception::Class ( 'REST::Neo4p::Exception', diff --git a/lib/REST/Neo4p/Index.pm b/lib/REST/Neo4p/Index.pm index 838a367..bf4684f 100644 --- a/lib/REST/Neo4p/Index.pm +++ b/lib/REST/Neo4p/Index.pm @@ -8,7 +8,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Index::VERSION = '0.4010'; + $REST::Neo4p::Index::VERSION = '0.4011'; } my $unsafe = "^A-Za-z0-9\-\._\ ~"; diff --git a/lib/REST/Neo4p/Node.pm b/lib/REST/Neo4p/Node.pm index da3eacd..1596bd1 100644 --- a/lib/REST/Neo4p/Node.pm +++ b/lib/REST/Neo4p/Node.pm @@ -3,12 +3,11 @@ package REST::Neo4p::Node; use base 'REST::Neo4p::Entity'; use REST::Neo4p::Relationship; use REST::Neo4p::Exceptions; -use JSON; use Carp qw(croak carp); use strict; use warnings; BEGIN { - $REST::Neo4p::Node::VERSION = '0.4010'; + $REST::Neo4p::Node::VERSION = '0.4011'; } # creation, deletion and property manipulation are delegated diff --git a/lib/REST/Neo4p/ParseStream.pm b/lib/REST/Neo4p/ParseStream.pm index 8420702..c65edf0 100644 --- a/lib/REST/Neo4p/ParseStream.pm +++ b/lib/REST/Neo4p/ParseStream.pm @@ -7,7 +7,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::ParseStream::VERSION = '0.4010'; + $REST::Neo4p::ParseStream::VERSION = '0.4011'; } our @EXPORT = qw/j_parse/;# j_parse_object j_parse_array /; @@ -28,6 +28,7 @@ sub j_parse { elsif ($j->incr_text =~ s/^\s*{\s*//) { # object my $type; + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental 'smartmatch'; given ($j->incr_text) { when (/^\s*"commit"/i) { @@ -122,7 +123,6 @@ sub j_parse_object { my $done; unless ($current eq 'PENDING') { my $m; - use experimental 'smartmatch'; eval { $j->incr_text =~ m/^(?:(\s*"([^"]+)"\s*:\s*)|(\s*}\s*))/; # look ahead $m = $2||$3; @@ -148,6 +148,7 @@ sub j_parse_object { } $key = $m; } + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental 'smartmatch'; given ($key) { when ('columns') { diff --git a/lib/REST/Neo4p/Path.pm b/lib/REST/Neo4p/Path.pm index 4b525ec..fcf81cc 100644 --- a/lib/REST/Neo4p/Path.pm +++ b/lib/REST/Neo4p/Path.pm @@ -6,7 +6,7 @@ use Scalar::Util qw(blessed); use strict; use warnings; BEGIN { - $REST::Neo4p::Path::VERSION = '0.4010'; + $REST::Neo4p::Path::VERSION = '0.4011'; } sub new { diff --git a/lib/REST/Neo4p/Query.pm b/lib/REST/Neo4p/Query.pm index 570af08..0c8b825 100644 --- a/lib/REST/Neo4p/Query.pm +++ b/lib/REST/Neo4p/Query.pm @@ -2,7 +2,7 @@ use v5.10; package REST::Neo4p::Query; use REST::Neo4p::Path; use REST::Neo4p::Exceptions; -use JSON::XS; +use JSON::MaybeXS (); use REST::Neo4p::ParseStream; use HOP::Stream qw/drop/; use Scalar::Util qw(blessed); @@ -14,7 +14,7 @@ use warnings; no warnings qw(once); BEGIN { - $REST::Neo4p::Query::VERSION = '0.4010'; + $REST::Neo4p::Query::VERSION = '0.4011'; } our $BUFSIZE = 50000; @@ -234,7 +234,7 @@ sub _wrap_statement_result { sub _parse_response { my $self = shift; - my $jsonr = JSON::XS->new->utf8; + my $jsonr = JSON::MaybeXS->new->utf8; my ($buf,$res,$str,$rowstr,$obj); my $row_count; $self->tmpf->read($buf, $BUFSIZE); diff --git a/lib/REST/Neo4p/Relationship.pm b/lib/REST/Neo4p/Relationship.pm index fc67df4..a4f4ac9 100644 --- a/lib/REST/Neo4p/Relationship.pm +++ b/lib/REST/Neo4p/Relationship.pm @@ -6,7 +6,7 @@ use Carp qw(croak carp); use strict; use warnings; BEGIN { - $REST::Neo4p::Relationship::VERSION = '0.4010'; + $REST::Neo4p::Relationship::VERSION = '0.4011'; } sub new { diff --git a/lib/REST/Neo4p/Schema.pm b/lib/REST/Neo4p/Schema.pm index afff68f..50885e9 100644 --- a/lib/REST/Neo4p/Schema.pm +++ b/lib/REST/Neo4p/Schema.pm @@ -7,7 +7,7 @@ use strict; use warnings; BEGIN { - $REST::Neo4p::Schema::VERSION = '0.4010'; + $REST::Neo4p::Schema::VERSION = '0.4011'; } #require 'REST::Neo4p'; diff --git a/t/0011_parse.t b/t/0011_parse.t index 74e2b01..e9fba71 100644 --- a/t/0011_parse.t +++ b/t/0011_parse.t @@ -4,7 +4,7 @@ use File::Spec; #use Devel::Leak; use lib '../lib'; use REST::Neo4p::ParseStream; -use JSON::XS; +use JSON::MaybeXS (); use HOP::Stream qw/head tail drop/; use experimental; use strict; @@ -13,7 +13,7 @@ use warnings; my $TESTDIR = (-d 't' ? 't' : '.'); my $CHUNK = 10000; -my $j = JSON::XS->new; +my $j = JSON::MaybeXS->new; open my $f, File::Spec->catfile($TESTDIR,'samples','qry-response.txt') or die $!; open my $g, File::Spec->catfile($TESTDIR, 'samples', 'batch-response.txt') or die $!; @@ -39,6 +39,7 @@ isa_ok($str, 'HOP::Stream'); my ($ct,$newct); while (my $obj = drop($str)) { + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental 'smartmatch'; is $obj->[0],'ARELT', "is array elt"; given ($obj->[1]) { @@ -64,7 +65,7 @@ is $j->incr_text,'', "All text consumed"; undef $res; undef $str; -$j = JSON::XS->new(); +$j = JSON::MaybeXS->new(); read ($f, $buf,$CHUNK) or die $!; $j->incr_parse($buf); ok $res = j_parse($j), "parsing qry response"; @@ -83,6 +84,7 @@ isa_ok($ar,'HOP::Stream'); ok $obj = drop($str), 'get paused stream entry'; is_deeply $obj, [qw/data DATA_STREAM/], 'paused for data stream'; while (my $obj = drop($ar)) { + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental 'smartmatch'; is $obj->[0],'ARELT', "is array elt"; given ($obj->[1]) { @@ -108,7 +110,7 @@ is $j->incr_text,'', 'all text consumed'; -$j = JSON::XS->new(); +$j = JSON::MaybeXS->new(); read($k, $buf,$CHUNK) or die $!; $j->incr_parse($buf); ok $res = j_parse($j), "parsing txn response"; @@ -134,6 +136,7 @@ while ($r_obj = drop($r_str)) { my $ar = $r_obj->[1]->(); isa_ok($ar,'HOP::Stream'); while (my $row = drop($ar)) { + no if $^V ge v5.37, warnings => 'deprecated::smartmatch'; use experimental 'smartmatch'; is $row->[0],'ARELT', "is array elt"; given ($row->[1]) { @@ -169,7 +172,7 @@ while (my $item = drop($ar)) { } open $k, File::Spec->catfile($TESTDIR, 'samples','null-txn-response.txt'); -$j = JSON::XS->new(); +$j = JSON::MaybeXS->new(); read($k, $buf,$CHUNK) or die $!; $j->incr_parse($buf); ok $res = j_parse($j), "parsing null txn response"; diff --git a/t/0021_rel_zero.t b/t/0021_rel_zero.t index 25a1107..d0bb46e 100644 --- a/t/0021_rel_zero.t +++ b/t/0021_rel_zero.t @@ -27,17 +27,17 @@ my $not_connected = connect($TEST_SERVER,$user,$pass); diag "Test server unavailable (".$not_connected->message.") : tests skipped" if $not_connected; sub skip_diag { - diag 'skip' . ( defined $_[0] ? " $_[0]" : '' ) unless $ENV{'HARNESS_IS_VERBOSE'}; + diag 'skip' . ( defined $_[0] ? " $_[0]" : '' ), $_[1] unless $ENV{'HARNESS_IS_VERBOSE'}; skip @_; } SKIP : { - skip 'no connection to neo4j' if $not_connected; + skip 'no connection to neo4j', 8 if $not_connected; ok my $n0 = REST::Neo4p::Node->new, 'create node 0'; # neo4j stop ; rm -rf /path/to/graph.db ; neo4j start - skip_diag '"relationship 0" test: only works on virgin database' unless $n0->id == 0; + skip_diag '"relationship 0" test: only works on virgin database', 7 unless $n0->id == 0; ok my $n1 = REST::Neo4p::Node->new, 'create node 1'; ok my $r0 = REST::Neo4p::Relationship->new( $n0 => $n1, 'zero' ), 'create reln 0'; diff --git a/t/097_parse_errors.t b/t/097_parse_errors.t index 250a1db..6b4d66c 100644 --- a/t/097_parse_errors.t +++ b/t/097_parse_errors.t @@ -7,7 +7,7 @@ use lib qw{t ../lib}; use Data::Dumper; use REST::Neo4p; use ErrJ; -use JSON; +use JSON::MaybeXS qw/encode_json/; use strict; use warnings; no warnings qw/once/; diff --git a/t/jparse_json_v4.t b/t/jparse_json_v4.t index 1c6991c..87f4207 100644 --- a/t/jparse_json_v4.t +++ b/t/jparse_json_v4.t @@ -6,18 +6,17 @@ use Test::Exception; use REST::Neo4p::Exceptions; use REST::Neo4p::ParseStream; use HOP::Stream qw/drop/; -use JSON; +use JSON::MaybeXS (); use ErrJ; use strict; my $j = $ErrJ::txn_short_resp; # $j = $ErrJ::txn_baddata_resp; -my $jsonr = JSON->new->utf8; +my $jsonr = JSON::MaybeXS->new->utf8; my ($ERR,$res,$str,$rowstr,$obj); my $ITER; my $row_count; -use experimental 'smartmatch'; $jsonr->incr_parse($j); eval { # capture j_parse errors diff --git a/t/json_utf8.t b/t/json_utf8.t index 6bbc3b1..d146087 100644 --- a/t/json_utf8.t +++ b/t/json_utf8.t @@ -9,7 +9,7 @@ use warnings; my @cleanup; use_ok('REST::Neo4p'); -use 5.012; +use if $^V ge v5.12, feature => 'unicode_strings'; use utf8; use Data::Dumper;