1
2use Test::More;
3BEGIN { plan tests => 1 };
4
5use JSON;
6
7my $str = 'http://www.example.com/';
8my $obj = Test->new($str);
9
10
11
12local $JSON::ConvBlessed = 1;
13
14is(objToJson([$obj]), qq|["$str"]|);
15
16
17
18package Test;
19
20sub new {
21    my ($class, $str) = @_;
22    bless \$str, $class;
23}
24
25