diff --git a/lib/JSON/Tiny.pm b/lib/JSON/Tiny.pm index 04920b3..d900902 100644 --- a/lib/JSON/Tiny.pm +++ b/lib/JSON/Tiny.pm @@ -32,13 +32,13 @@ multi to-json(Str:D $d) { # .subst(/<-[\ ..~]>/, { ord(~$_).fmt('\u%04x') }, :g) # ~ '"' state %esc = - '"' => '\"', + '"' => '\"', '\\' => '\\\\', - '\b' => '\b', - '\f' => '\f', - '\n' => '\n', - '\r' => '\r', - '\t' => '\t', + "\b" => '\b', + "\f" => '\f', + "\n" => '\n', + "\r" => '\r', + "\t" => '\t', ; '"' diff --git a/t/04-roundtrip.t b/t/04-roundtrip.t index 07238f5..21ff3ef 100644 --- a/t/04-roundtrip.t +++ b/t/04-roundtrip.t @@ -35,7 +35,7 @@ plan +@s; for @s.kv -> $k, $v { #warn "The json is <{ to-json( .value ) }>"; my $r = from-json( to-json( $v.value ) ); - todo('known type mismatches') if $k == any(5, 9); + todo('known type mismatches') if $k == 9; is_deeply $r, $v.value, $v.key or say "# Got: {$r.perl}\n# Expected: $v.value.perl()"; }