⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.177
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
.cpan
/
build
/
JSON-4.10-0
/
t
/
View File Name :
gh_28_json_test_suite.t
# the following test cases are taken from JSONTestSuite # by Nicolas Seriot (https://github.com/nst/JSONTestSuite) use strict; use warnings; use Test::More; BEGIN { plan skip_all => 'this test is for Perl 5.8 or later' if $] < 5.008; } BEGIN { plan tests => 20 }; BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; } use JSON; my $DECODER = JSON->new->utf8->allow_nonref; # n_multidigit_number_then_00 decode_should_fail(qq!123\x00!); # number_-01 decode_should_fail(qq![-01]!); # number_neg_int_starting_with_zero decode_should_fail(qq![-012]!); # n_object_trailing_comment decode_should_fail(qq!{"a":"b"}/**/!); # n_object_trailing_comment_slash_open decode_should_fail(qq!{"a":"b"}//!); # 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 { my $json = shift; my $result = eval { $DECODER->decode($json); }; ok $@, $@ || ''; ok !defined $result; }