Line-wraps at 80 chars.

pull/155/head
Chris Fallin 10 years ago
parent addd26cbb3
commit ace4212e60
  1. 15
      ruby/tests/basic.rb

@ -479,7 +479,8 @@ module BasicTest
m["jkl;"] = TestMessage2.new
end
m = Google::Protobuf::Map.new(:string, :message, TestMessage,
m = Google::Protobuf::Map.new(
:string, :message, TestMessage,
{ "a" => TestMessage.new(:optional_int32 => 42),
"b" => TestMessage.new(:optional_int32 => 84) })
assert m.length == 2
@ -502,7 +503,8 @@ module BasicTest
end
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),
"b" => TestMessage.new(:optional_int32 => 84) })
@ -524,7 +526,8 @@ module BasicTest
assert m.map_string_int32 == {}
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),
"b" => TestMessage2.new(:foo => 2)})
assert m.map_string_int32.keys.sort == ["a", "b"]
@ -559,7 +562,8 @@ module BasicTest
end
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),
"b" => TestMessage2.new(:foo => 2)})
m2 = MapMessage.decode(MapMessage.encode(m))
@ -638,7 +642,8 @@ module BasicTest
:repeated_string => ["a", "b", "c"],
:repeated_int32 => [42, 43, 44],
: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
m2 = TestMessage.decode data
assert m == m2

Loading…
Cancel
Save