1 | # provided by makamaka@donzoko.net. |
1 | # provided by IKEGAMI@cpan.org |
2 | |
2 | |
3 | use strict; |
3 | use strict; |
4 | use warnings; |
4 | use warnings; |
5 | |
5 | |
6 | use Test::More tests => 12; |
6 | use Test::More tests => 13; |
7 | |
7 | |
8 | use JSON::XS; |
8 | use JSON::XS; |
9 | |
9 | |
10 | use Data::Dumper qw( Dumper ); |
10 | use Data::Dumper qw( Dumper ); |
11 | |
11 | |
… | |
… | |
40 | is( decoder( " " ), 'undef', 'space ignored before eof' ); |
40 | is( decoder( " " ), 'undef', 'space ignored before eof' ); |
41 | is( decoder( "\n" ), 'undef', 'newline ignored before eof' ); |
41 | is( decoder( "\n" ), 'undef', 'newline ignored before eof' ); |
42 | is( decoder( "#,foo\n" ), 'undef', 'comment ignored before eof' ); |
42 | is( decoder( "#,foo\n" ), 'undef', 'comment ignored before eof' ); |
43 | is( decoder( "# []o\n" ), 'undef', 'comment ignored before eof' ); |
43 | is( decoder( "# []o\n" ), 'undef', 'comment ignored before eof' ); |
44 | |
44 | |
|
|
45 | is( decoder(qq/#\n[#foo\n"#\\n"#\n]/), '["#\n"]', 'array and string in multiple lines' ); |
|
|
46 | |