aboutsummaryrefslogtreecommitdiff
path: root/ruby/tests/basic.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ruby/tests/basic.rb')
-rw-r--r--ruby/tests/basic.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/ruby/tests/basic.rb b/ruby/tests/basic.rb
index f81e456c..989a047e 100644
--- a/ruby/tests/basic.rb
+++ b/ruby/tests/basic.rb
@@ -183,12 +183,15 @@ module BasicTest
def test_hash
m1 = TestMessage.new(:optional_int32 => 42)
- m2 = TestMessage.new(:optional_int32 => 102)
+ m2 = TestMessage.new(:optional_int32 => 102, repeated_string: ['please', 'work', 'ok?'])
+ m3 = TestMessage.new(:optional_int32 => 102, repeated_string: ['please', 'work', 'ok?'])
assert m1.hash != 0
assert m2.hash != 0
+ assert m3.hash != 0
# relying on the randomness here -- if hash function changes and we are
# unlucky enough to get a collision, then change the values above.
assert m1.hash != m2.hash
+ assert_equal m2.hash, m3.hash
end
def test_unknown_field_errors
@@ -468,9 +471,9 @@ module BasicTest
assert m.length == 2
m2 = m.dup
- assert m == m2
+ assert_equal m, m2
assert m.hash != 0
- assert m.hash == m2.hash
+ assert_equal m.hash, m2.hash
collected = {}
m.each { |k,v| collected[v] = k }