Skip to content

Commit

Permalink
fix stupid thinko
Browse files Browse the repository at this point in the history
now all tests pass at least as good as on rakudo 2011.07
  • Loading branch information
moritz committed Dec 21, 2011
1 parent fb102c3 commit 87dbbaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/JSON/Tiny.pm
Expand Up @@ -32,13 +32,13 @@ multi to-json(Str:D $d) {
# .subst(/<-[\ ..~]>/, { ord(~$_).fmt('\u%04x') }, :g) # .subst(/<-[\ ..~]>/, { ord(~$_).fmt('\u%04x') }, :g)
# ~ '"' # ~ '"'
state %esc = state %esc =
'"' => '\"', '"' => '\"',
'\\' => '\\\\', '\\' => '\\\\',
'\b' => '\b', "\b" => '\b',
'\f' => '\f', "\f" => '\f',
'\n' => '\n', "\n" => '\n',
'\r' => '\r', "\r" => '\r',
'\t' => '\t', "\t" => '\t',
; ;


'"' '"'
Expand Down
2 changes: 1 addition & 1 deletion t/04-roundtrip.t
Expand Up @@ -35,7 +35,7 @@ plan +@s;
for @s.kv -> $k, $v { for @s.kv -> $k, $v {
#warn "The json is <{ to-json( .value ) }>"; #warn "The json is <{ to-json( .value ) }>";
my $r = from-json( to-json( $v.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 is_deeply $r, $v.value, $v.key
or say "# Got: {$r.perl}\n# Expected: $v.value.perl()"; or say "# Got: {$r.perl}\n# Expected: $v.value.perl()";
} }
Expand Down

0 comments on commit 87dbbaa

Please sign in to comment.