Navigation Menu

Skip to content

Commit

Permalink
test Mojo::JSON decoding with duplicate keys
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 21, 2013
1 parent 00e726a commit e4874cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.86 2013-02-20
3.86 2013-02-21
- Improved portability of Mojo::Asset::File tests.
- Improved documentation.
- Improved tests. (jberger, sri)
Expand Down
4 changes: 4 additions & 0 deletions t/mojo/json.t
Expand Up @@ -223,6 +223,10 @@ $array
= $json->decode(b("[\"\\ud800\\udf46\"]")->encode('UTF-32BE')->to_string);
is_deeply $array, ["\x{10346}"], 'decode [\"\\ud800\\udf46\"]';

# Decode object with duplicate keys
$hash = $json->decode('{"foo": 1, "foo": 2}');
is_deeply $hash, {foo => 2}, 'decode {"foo": 1, "foo": 2}';

# Complicated roudtrips
$bytes = '[null,false,true,"",0,1]';
$array = $json->decode($bytes);
Expand Down

0 comments on commit e4874cb

Please sign in to comment.