����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
use strict;
use warnings;
use Test::More;
BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; }
use JSON;
plan skip_all => "not for older version of JSON::PP" if JSON->backend->isa('JSON::PP') && JSON->backend->VERSION < 4.09;
plan tests => 19 * 3 + 1 * 6;
sub run_test {
my ($input, $sub) = @_;
$sub->($input);
}
run_test('{"one": 1}', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok ($res, "curly braces okay -- '$input'");
ok (!$e, "no error -- '$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error");
});
run_test('{"one": 1]', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "unbalanced curly braces -- '$input'");
ok ($e, "got error -- '$input'");
like ($e, qr/, or \} expected while parsing object\/hash/, "'} expected' json string error");
});
run_test('"', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('{', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('[', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('}', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok ($e, "no error for input='$input'");
like ($e, qr/malformed JSON string/, "'malformed JSON string' json string error for input='$input'");
});
run_test(']', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok ($e, "no error for input='$input'");
like ($e, qr/malformed JSON string/, "'malformed JSON string' json string error for input='$input'");
});
run_test('1', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok ($res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/malformed JSON string/, "'malformed JSON string' json string error for input='$input'");
});
run_test('1', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(0);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok ($e, "no error for input='$input'");
like ($e, qr/JSON text must be an object or array/, "'JSON text must be an object or array' json string error for input='$input'");
});
run_test('"1', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/malformed JSON string/, "'malformed JSON string' json string error for input='$input'");
});
run_test('\\', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok ($e, "no error for input='$input'");
like ($e, qr/malformed JSON string/, "'malformed JSON string' json string error for input='$input'");
});
run_test('{"one": "', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('{"one": {', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('{"one": [', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('{"one": t', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('{"one": \\', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('{"one": ', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('{"one": 1', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
});
run_test('{"one": {"two": 2', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated '$input'");
ok (!$e, "no error -- '$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error -- $input");
});
# Test Appending Closing '}' Curly Bracket
run_test('{"one": 1', sub {
my $input = shift;
my $coder = JSON->new->allow_nonref(1);
my $res = eval { $coder->incr_parse($input) };
my $e = $@; # test more clobbers $@, we need it twice
ok (!$res, "truncated input='$input'");
ok (!$e, "no error for input='$input'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input'");
$res = eval { $coder->incr_parse('}') };
$e = $@; # test more clobbers $@, we need it twice
ok ($res, "truncated input='$input' . '}'");
ok (!$e, "no error for input='$input' . '}'");
unlike ($e, qr/, or \} expected while parsing object\/hash/, "No '} expected' json string error for input='$input' . '}'");
});
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| 00_backend_version.t | File | 177 B | 0644 |
|
| 00_load.t | File | 266 B | 0644 |
|
| 00_load_backport_pp.t | File | 329 B | 0644 |
|
| 01_utf8.t | File | 1.3 KB | 0644 |
|
| 02_error.t | File | 2.91 KB | 0644 |
|
| 03_types.t | File | 2.48 KB | 0644 |
|
| 04_dwiw_encode.t | File | 2.09 KB | 0644 |
|
| 05_dwiw_decode.t | File | 2.09 KB | 0644 |
|
| 06_pc_pretty.t | File | 1.25 KB | 0644 |
|
| 07_pc_esc.t | File | 1.97 KB | 0644 |
|
| 08_pc_base.t | File | 2.14 KB | 0644 |
|
| 09_pc_extra_number.t | File | 770 B | 0644 |
|
| 104_sortby.t | File | 696 B | 0644 |
|
| 105_esc_slash.t | File | 325 B | 0644 |
|
| 106_allow_barekey.t | File | 402 B | 0644 |
|
| 107_allow_singlequote.t | File | 526 B | 0644 |
|
| 108_decode.t | File | 1.09 KB | 0644 |
|
| 109_encode.t | File | 1.12 KB | 0644 |
|
| 10_pc_keysort.t | File | 481 B | 0644 |
|
| 110_bignum.t | File | 1.45 KB | 0644 |
|
| 112_upgrade.t | File | 448 B | 0644 |
|
| 113_overloaded_eq.t | File | 1022 B | 0644 |
|
| 114_decode_prefix.t | File | 890 B | 0644 |
|
| 115_tie_ixhash.t | File | 754 B | 0644 |
|
| 116_incr_parse_fixed.t | File | 470 B | 0644 |
|
| 117_numbers.t | File | 850 B | 0644 |
|
| 118_boolean_values.t | File | 3.48 KB | 0644 |
|
| 119_incr_parse_utf8.t | File | 2.21 KB | 0644 |
|
| 11_pc_expo.t | File | 1.62 KB | 0644 |
|
| 120_incr_parse_truncated.t | File | 8.7 KB | 0644 |
|
| 12_blessed.t | File | 1.43 KB | 0644 |
|
| 13_limit.t | File | 903 B | 0644 |
|
| 14_latin1.t | File | 520 B | 0644 |
|
| 15_prefix.t | File | 407 B | 0644 |
|
| 16_tied.t | File | 405 B | 0644 |
|
| 17_relaxed.t | File | 669 B | 0644 |
|
| 18_json_checker.t | File | 3.86 KB | 0644 |
|
| 19_incr.t | File | 3.32 KB | 0644 |
|
| 20_faihu.t | File | 963 B | 0644 |
|
| 20_unknown.t | File | 1003 B | 0644 |
|
| 21_evans.t | File | 506 B | 0644 |
|
| 22_comment_at_eof.t | File | 1.44 KB | 0644 |
|
| 52_object.t | File | 1.18 KB | 0644 |
|
| 99_binary.t | File | 1.47 KB | 0644 |
|
| e00_func.t | File | 311 B | 0644 |
|
| e01_property.t | File | 1.62 KB | 0644 |
|
| e02_bool.t | File | 1.39 KB | 0644 |
|
| e03_bool2.t | File | 1.13 KB | 0644 |
|
| e11_conv_blessed_univ.t | File | 872 B | 0644 |
|
| e90_misc.t | File | 425 B | 0644 |
|
| gh_28_json_test_suite.t | File | 1.27 KB | 0644 |
|
| gh_29_trailing_false_value.t | File | 330 B | 0644 |
|
| rt_116998_wrong_character_offset.t | File | 718 B | 0644 |
|
| rt_122270_is_bool_for_obsolete_xs_boolean.t | File | 875 B | 0644 |
|
| rt_122270_old_xs_boolean.t | File | 875 B | 0644 |
|
| rt_90071_incr_parse.t | File | 816 B | 0644 |
|
| x00_load.t | File | 301 B | 0644 |
|
| x02_error.t | File | 2.63 KB | 0644 |
|
| x12_blessed.t | File | 1.38 KB | 0644 |
|
| x16_tied.t | File | 398 B | 0644 |
|
| x17_strange_overload.t | File | 484 B | 0644 |
|
| xe04_escape_slash.t | File | 423 B | 0644 |
|
| xe05_indent_length.t | File | 1.22 KB | 0644 |
|
| xe12_boolean.t | File | 555 B | 0644 |
|
| xe19_xs_and_suportbypp.t | File | 604 B | 0644 |
|
| xe20_croak_message.t | File | 585 B | 0644 |
|
| xe21_is_pp.t | File | 581 B | 0644 |
|
| zero-mojibake.t | File | 389 B | 0644 |
|