Commit ace4212e authored by Chris Fallin's avatar Chris Fallin

Line-wraps at 80 chars.

parent addd26cb
...@@ -479,7 +479,8 @@ module BasicTest ...@@ -479,7 +479,8 @@ module BasicTest
m["jkl;"] = TestMessage2.new m["jkl;"] = TestMessage2.new
end end
m = Google::Protobuf::Map.new(:string, :message, TestMessage, m = Google::Protobuf::Map.new(
:string, :message, TestMessage,
{ "a" => TestMessage.new(:optional_int32 => 42), { "a" => TestMessage.new(:optional_int32 => 42),
"b" => TestMessage.new(:optional_int32 => 84) }) "b" => TestMessage.new(:optional_int32 => 84) })
assert m.length == 2 assert m.length == 2
...@@ -502,7 +503,8 @@ module BasicTest ...@@ -502,7 +503,8 @@ module BasicTest
end end
def test_map_dup_deep_copy def test_map_dup_deep_copy
m = Google::Protobuf::Map.new(:string, :message, TestMessage, m = Google::Protobuf::Map.new(
:string, :message, TestMessage,
{ "a" => TestMessage.new(:optional_int32 => 42), { "a" => TestMessage.new(:optional_int32 => 42),
"b" => TestMessage.new(:optional_int32 => 84) }) "b" => TestMessage.new(:optional_int32 => 84) })
...@@ -524,7 +526,8 @@ module BasicTest ...@@ -524,7 +526,8 @@ module BasicTest
assert m.map_string_int32 == {} assert m.map_string_int32 == {}
assert m.map_string_msg == {} assert m.map_string_msg == {}
m = MapMessage.new(:map_string_int32 => {"a" => 1, "b" => 2}, m = MapMessage.new(
:map_string_int32 => {"a" => 1, "b" => 2},
:map_string_msg => {"a" => TestMessage2.new(:foo => 1), :map_string_msg => {"a" => TestMessage2.new(:foo => 1),
"b" => TestMessage2.new(:foo => 2)}) "b" => TestMessage2.new(:foo => 2)})
assert m.map_string_int32.keys.sort == ["a", "b"] assert m.map_string_int32.keys.sort == ["a", "b"]
...@@ -559,7 +562,8 @@ module BasicTest ...@@ -559,7 +562,8 @@ module BasicTest
end end
def test_map_encode_decode def test_map_encode_decode
m = MapMessage.new(:map_string_int32 => {"a" => 1, "b" => 2}, m = MapMessage.new(
:map_string_int32 => {"a" => 1, "b" => 2},
:map_string_msg => {"a" => TestMessage2.new(:foo => 1), :map_string_msg => {"a" => TestMessage2.new(:foo => 1),
"b" => TestMessage2.new(:foo => 2)}) "b" => TestMessage2.new(:foo => 2)})
m2 = MapMessage.decode(MapMessage.encode(m)) m2 = MapMessage.decode(MapMessage.encode(m))
...@@ -638,7 +642,8 @@ module BasicTest ...@@ -638,7 +642,8 @@ module BasicTest
:repeated_string => ["a", "b", "c"], :repeated_string => ["a", "b", "c"],
:repeated_int32 => [42, 43, 44], :repeated_int32 => [42, 43, 44],
:repeated_enum => [:A, :B, :C, 100], :repeated_enum => [:A, :B, :C, 100],
:repeated_msg => [TestMessage2.new(:foo => 1), TestMessage2.new(:foo => 2)]) :repeated_msg => [TestMessage2.new(:foo => 1),
TestMessage2.new(:foo => 2)])
data = TestMessage.encode m data = TestMessage.encode m
m2 = TestMessage.decode data m2 = TestMessage.decode data
assert m == m2 assert m == m2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment