File: u-in-key.t

package info (click to toggle)
libjson-parse-perl 0.62-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 572 kB
  • sloc: ansic: 3,614; perl: 475; makefile: 12
file content (17 lines) | stat: -rw-r--r-- 517 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use FindBin '$Bin';
use lib "$Bin";
use JPT;
my $test = <<'EOF';
{"\u0041":"A","\u3000":" ","\t":"tab"}
EOF
my $out = parse_json ($test);
TODO: {
    local $TODO = 'Support \u escapes in keys';
    ok ($out->{A}, "Got a key");
    is ($out->{A}, 'A', "Got right value for A");
    ok ($out->{' '}, "Got U+3000 key");
    is ($out->{' '}, ' ', "Got right value for U+3000");
    ok ($out->{"\x{09}"}, "got a tab as key");
    is ($out->{"\x{09}"}, 'tab', "Got right value for tab as key");
};
done_testing ();