|
|
|
@ -103,7 +103,7 @@ module CommonTests |
|
|
|
|
assert_equal 3, m.repeated_msg.first.sub_child.optional_int32 |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def test_inspect |
|
|
|
|
def test_inspect_eq_to_s |
|
|
|
|
m = proto_module::TestMessage.new( |
|
|
|
|
:optional_int32 => -42, |
|
|
|
|
:optional_enum => :A, |
|
|
|
@ -111,10 +111,12 @@ module CommonTests |
|
|
|
|
:repeated_string => ["hello", "there", "world"]) |
|
|
|
|
expected = "<#{proto_module}::TestMessage: optional_int32: -42, optional_int64: 0, optional_uint32: 0, optional_uint64: 0, optional_bool: false, optional_float: 0.0, optional_double: 0.0, optional_string: \"\", optional_bytes: \"\", optional_msg: <#{proto_module}::TestMessage2: foo: 0>, optional_enum: :A, repeated_int32: [], repeated_int64: [], repeated_uint32: [], repeated_uint64: [], repeated_bool: [], repeated_float: [], repeated_double: [], repeated_string: [\"hello\", \"there\", \"world\"], repeated_bytes: [], repeated_msg: [], repeated_enum: []>" |
|
|
|
|
assert_equal expected, m.inspect |
|
|
|
|
assert_equal expected, m.to_s |
|
|
|
|
|
|
|
|
|
m = proto_module::OneofMessage.new(:b => -42) |
|
|
|
|
expected = "<#{proto_module}::OneofMessage: a: \"\", b: -42, c: nil, d: :Default>" |
|
|
|
|
assert_equal expected, m.inspect |
|
|
|
|
assert_equal expected, m.to_s |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def test_hash |
|
|
|
|