use strict;
use warnings;
use Test::More;
-use DOM::Tiny::Collection 'c';
-use JSON::Tiny 'encode_json';
+use DOM::Tiny::_Collection;
+use JSON::PP ();
+
+sub c { DOM::Tiny::_Collection->new(@_) }
# Array
is c(1, 2, 3)->[1], 2, 'right result';
'right order';
is_deeply $collection->sort(sub { $_[1] cmp $_[0] })->to_array, [5, 4, 2, 1],
'right order';
-$collection = c(qw(Test perl Mojo));
+$collection = c(qw(Test perl DOM));
is_deeply $collection->sort(sub { uc(shift) cmp uc(shift) })->to_array,
- [qw(Mojo perl Test)], 'right order';
+ [qw(DOM perl Test)], 'right order';
$collection = c();
is_deeply $collection->sort->to_array, [], 'no elements';
is_deeply $collection->sort(sub { $a cmp $b })->to_array, [], 'no elements';
'right result';
# TO_JSON
-is encode_json(c(1, 2, 3)), '[1,2,3]', 'right result';
+is +JSON::PP->new->convert_blessed->encode(c(1, 2, 3)), '[1,2,3]', 'right result';
done_testing();