diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2015-02-05 15:22:17 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2015-02-05 15:22:17 -0800 |
commit | 20490e33cae8d21a2e37e4383a4f1330612be49c (patch) | |
tree | d3e6a0c1738f92b7a0b41d2f0c9a551d71389aeb /ruby/tests | |
parent | e7e79a43ed13b25232384eeeabf4089026876e9d (diff) | |
parent | 06bf6308eae55571c36a580a55dab71856041de1 (diff) |
Merge pull request #189 from cfallin/update-ruby-upb
Updated to latest upb and added test for JSON map operation.
Diffstat (limited to 'ruby/tests')
-rw-r--r-- | ruby/tests/basic.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ruby/tests/basic.rb b/ruby/tests/basic.rb index 321b1d34..97d1099e 100644 --- a/ruby/tests/basic.rb +++ b/ruby/tests/basic.rb @@ -992,5 +992,13 @@ module BasicTest m2 = TestMessage.decode_json(json_text) assert m == m2 end + + def test_json_maps + m = MapMessage.new(:map_string_int32 => {"a" => 1}) + expected = '{"map_string_int32":{"a":1},"map_string_msg":{}}' + assert MapMessage.encode_json(m) == expected + m2 = MapMessage.decode_json(MapMessage.encode_json(m)) + assert m == m2 + end end end |