diff options
author | Josh Haberman <jhaberman@gmail.com> | 2017-03-14 14:27:16 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2017-03-14 14:27:16 -0700 |
commit | 9c6b8cb9bfc7c31ec99566772246c9bc4317c57b (patch) | |
tree | e9820cf16923e653ee38442218d8aac82d63ec62 /ruby/tests | |
parent | 43f2db776c265a9b22500e7a67af583b2b4ce85f (diff) | |
download | protobuf-9c6b8cb9bfc7c31ec99566772246c9bc4317c57b.tar.gz protobuf-9c6b8cb9bfc7c31ec99566772246c9bc4317c57b.tar.bz2 protobuf-9c6b8cb9bfc7c31ec99566772246c9bc4317c57b.zip |
Ruby: fixed Message#to_h for map fields.
Diffstat (limited to 'ruby/tests')
-rw-r--r-- | ruby/tests/basic.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ruby/tests/basic.rb b/ruby/tests/basic.rb index ca81e3a5..ff7576b8 100644 --- a/ruby/tests/basic.rb +++ b/ruby/tests/basic.rb @@ -927,6 +927,16 @@ module BasicTest :repeated_uint64=>[] } assert_equal expected_result, m.to_h + + m = MapMessage.new( + :map_string_int32 => {"a" => 1, "b" => 2}, + :map_string_msg => {"a" => TestMessage2.new(:foo => 1), + "b" => TestMessage2.new(:foo => 2)}) + expected_result = { + :map_string_int32=>{"a"=>1, "b"=>2}, + :map_string_msg=>{"a"=>{:foo=>1}, "b"=>{:foo=>2}} + } + assert_equal expected_result, m.to_h end |