mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test.
https://bugs.ruby-lang.org/issues/10984#note-13 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fd36c7524d
commit
66ef9b9310
1 changed files with 25 additions and 0 deletions
|
@ -1333,6 +1333,31 @@ class TestHash < Test::Unit::TestCase
|
|||
assert_not_operator(h2, :>, h2)
|
||||
end
|
||||
|
||||
def test_cmp_samekeys
|
||||
h1 = {a:1}
|
||||
h2 = {a:2}
|
||||
|
||||
assert_operator(h1, :<=, h1)
|
||||
assert_not_operator(h1, :<=, h2)
|
||||
assert_not_operator(h2, :<=, h1)
|
||||
assert_operator(h2, :<=, h2)
|
||||
|
||||
assert_operator(h1, :>=, h1)
|
||||
assert_not_operator(h1, :>=, h2)
|
||||
assert_not_operator(h2, :>=, h1)
|
||||
assert_operator(h2, :>=, h2)
|
||||
|
||||
assert_not_operator(h1, :<, h1)
|
||||
assert_not_operator(h1, :<, h2)
|
||||
assert_not_operator(h2, :<, h1)
|
||||
assert_not_operator(h2, :<, h2)
|
||||
|
||||
assert_not_operator(h1, :>, h1)
|
||||
assert_not_operator(h1, :>, h2)
|
||||
assert_not_operator(h2, :>, h1)
|
||||
assert_not_operator(h2, :>, h2)
|
||||
end
|
||||
|
||||
def test_to_proc
|
||||
h = {
|
||||
1 => 10,
|
||||
|
|
Loading…
Add table
Reference in a new issue