--- JSON-XS/t/08_pc_base.t 2007/03/23 15:10:56 1.1 +++ JSON-XS/t/08_pc_base.t 2007/03/29 02:45:49 1.3 @@ -3,7 +3,7 @@ # copied over from JSON::PC and modified to use JSON::XS use strict; -BEGIN { plan tests => 22 }; +BEGIN { plan tests => 20 }; use JSON::XS; my ($js,$obj); @@ -81,24 +81,15 @@ eval q{ $pc->decode($js) }; like($@, qr/unexpected end/i); -$obj = { foo => sub { "bar"; } }; +$obj = { foo => sub { "bar" } }; eval q{ $js = $pc->encode($obj) }; like($@, qr/JSON can only/i, 'invalid value (coderef)'); - -$obj = { foo => *STDERR }; -$js = $pc->encode($obj); -is($js, '{"foo":"*main::STDERR"}', "type blog"); - -$obj = { foo => \*STDERR }; -eval q{ $js = $pc->encode($obj) }; -like($@, qr/JSON can only/i, 'invalid value (ref of type blog)'); - #$obj = { foo => bless {}, "Hoge" }; #eval q{ $js = $pc->encode($obj) }; #like($@, qr/JSON can only/i, 'invalid value (blessd object)'); $obj = { foo => \$js }; eval q{ $js = $pc->encode($obj) }; -like($@, qr/JSON can only/i, 'invalid value (ref)'); +like($@, qr/cannot encode reference/i, 'invalid value (ref)');