Fix tautological assertions in test_each_value in test_hash.rb

Both assertions tested `[].length == 0` rather than `res.length`,
so the test passed even when `each_value` yielded nothing.
This commit is contained in:
Sampo Kuokkanen 2026-05-27 13:00:24 +09:00 committed by Nobuyoshi Nakada
parent eb70a0d0c4
commit 261eea422a
Notes: git 2026-05-27 05:13:15 +00:00

View File

@ -465,10 +465,10 @@ class TestHash < Test::Unit::TestCase
def test_each_value
res = []
@cls[].each_value { |v| res << v }
assert_equal(0, [].length)
assert_equal(0, res.length)
@h.each_value { |v| res << v }
assert_equal(0, [].length)
assert_equal(@h.size, res.length)
expected = []
@h.each { |k, v| expected << v }