ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/t/22_comment_at_eof.t
(Generate patch)

Comparing JSON-XS/t/22_comment_at_eof.t (file contents):
Revision 1.1 by root, Wed Jan 6 08:01:39 2010 UTC vs.
Revision 1.2 by root, Wed Jan 6 08:02:19 2010 UTC

1# provided by makamaka@donzoko.net. 1# provided by makamaka@donzoko.net.
2 2
3use strict; 3use strict;
4use warnings; 4use warnings;
5 5
6use Test::More tests => 11; 6use Test::More tests => 12;
7 7
8use JSON::XS; 8use JSON::XS;
9 9
10use Data::Dumper qw( Dumper ); 10use Data::Dumper qw( Dumper );
11 11
32is( decoder( " []" ), '[]', 'space ignored before array' ); 32is( decoder( " []" ), '[]', 'space ignored before array' );
33is( decoder( "\n[]" ), '[]', 'newline ignored before array' ); 33is( decoder( "\n[]" ), '[]', 'newline ignored before array' );
34is( decoder( "# foo\n[]" ), '[]', 'comment ignored before array' ); 34is( decoder( "# foo\n[]" ), '[]', 'comment ignored before array' );
35is( decoder( "# fo[o\n[]"), '[]', 'comment ignored before array' ); 35is( decoder( "# fo[o\n[]"), '[]', 'comment ignored before array' );
36is( decoder( "# fo]o\n[]"), '[]', 'comment ignored before array' ); 36is( decoder( "# fo]o\n[]"), '[]', 'comment ignored before array' );
37is( decoder( "[# fo]o\n]"), '[]', 'comment ignored inside array' );
37 38
38is( decoder( "" ), 'undef', 'eof baseline' ); 39is( decoder( "" ), 'undef', 'eof baseline' );
39is( decoder( " " ), 'undef', 'space ignored before eof' ); 40is( decoder( " " ), 'undef', 'space ignored before eof' );
40is( decoder( "\n" ), 'undef', 'newline ignored before eof' ); 41is( decoder( "\n" ), 'undef', 'newline ignored before eof' );
41is( decoder( "#,foo\n" ), 'undef', 'comment ignored before eof' ); 42is( decoder( "#,foo\n" ), 'undef', 'comment ignored before eof' );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines