JSON

 view release on metacpan or  search on metacpan

t/gh_28_json_test_suite.t  view on Meta::CPAN


# n_structure_null-byte-outside-sting
decode_should_fail(qq![\x00]!);

# n_structure_object_with_comment
decode_should_fail(qq!{"a":/*comment*/"b"}!);

# n_structure_whitespace_formfeed
decode_should_fail(qq![\0x0c]!);

# y_string_utf16BE_no_BOM
decode_should_pass(qq!\x00[\x00"\x00\xE9\x00"\x00]!);

# y_string_utf16LE_no_BOM
decode_should_pass(qq![\x00"\x00\xE9\x00"\x00]\x00!);

sub decode_should_pass {
    my $json = shift;
    my $result = eval { $DECODER->decode($json); };
    ok !$@, $@ || '';
    ok defined $result;
}

sub decode_should_fail {



( run in 0.656 second using v1.01-cache-2.11-cpan-e9daa2b36ef )