1# copied over from JSON::XS and modified to use JSON::PP 2 3use strict; 4use warnings; 5use Test::More; 6BEGIN { plan tests => 4 }; 7 8BEGIN { $ENV{PERL_JSON_BACKEND} = 0; } 9 10use JSON::PP; 11 12my $pp = JSON::PP->new->latin1->allow_nonref; 13 14ok ($pp->encode ("\x{12}\x{b6} ") eq "\"\\u0012\x{b6} \""); 15ok ($pp->encode ("\x{12}\x{b6}\x{abc}") eq "\"\\u0012\x{b6}\\u0abc\""); 16 17ok ($pp->decode ("\"\\u0012\x{b6}\"" ) eq "\x{12}\x{b6}"); 18ok ($pp->decode ("\"\\u0012\x{b6}\\u0abc\"") eq "\x{12}\x{b6}\x{abc}"); 19 20