Skip to content

Commit

Permalink
Tighten the TODO tests
Browse files Browse the repository at this point in the history
to only the tests which still fail: \u and \/ or SingleQuote
  • Loading branch information
Reini Urban authored and toddr committed Apr 18, 2017
1 parent f349f27 commit de43df6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions t/json-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ my @tests = (
'{"foo":""}',
'["\"://\""]',
'"~foo"',
{ TEST => '"\/"', TODO => "backslashed char not working yet" }, # escaped solidus
{ TEST => '"\/"', TODO => "backslashed char not working yet" }, # escaped solidus
'"\""',
{ TEST => '"\b"', TODO => "backslashed char not working yet" },
{ TEST => '"\f"', TODO => "backslashed char not working yet" },
{ TEST => '"\n"', TODO => "backslashed char not working yet" },
{ TEST => '"\r"', TODO => "backslashed char not working yet" },
{ TEST => '"\t"', TODO => "backslashed char not working yet" },
{ TEST => '"\u0001"', TODO => "backslashed char not working yet" },
{ TEST => '"\t"', TODO => "backslashed \\t not working yet" },
{ TEST => '"\u0001"', TODO => "backslashed \\u not working yet" },
);

plan tests => scalar @tests * ( 2 + $HAS_JSON ) * 2;
Expand All @@ -67,7 +67,9 @@ TODO: {

local $TODO;
if ( ref $test eq 'HASH' ) {
$TODO = $test->{TODO};
if ($single_quote or substr($test->{TEST},2,1) =~ m|[u/]|) {
$TODO = $test->{TODO};
}
$test = $test->{TEST};
}

Expand All @@ -87,7 +89,8 @@ TODO: {
s/([,:]) /$1/eg;
}

my $desc = "roundtrip $test -> " . Dumper($data) . " -> $json -> sq:$single_quote utf8:$unicode ";
my $desc = "roundtrip $test -> " . Dumper($data)
. " -> $json -> sq:$single_quote utf8:$unicode ";
utf8::encode($desc);
is $json, $test, $desc;

Expand Down

0 comments on commit de43df6

Please sign in to comment.