mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Make tests for Set#inspect more straightforward
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7eb444d9a3
commit
cb1d634d6a
1 changed files with 4 additions and 5 deletions
|
@ -705,15 +705,14 @@ class TC_Set < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_inspect
|
def test_inspect
|
||||||
set1 = Set[1]
|
set1 = Set[1, 2]
|
||||||
|
assert_equal('#<Set: {1, 2}>', set1.inspect)
|
||||||
assert_equal('#<Set: {1}>', set1.inspect)
|
|
||||||
|
|
||||||
set2 = Set[Set[0], 1, 2, set1]
|
set2 = Set[Set[0], 1, 2, set1]
|
||||||
assert_equal(false, set2.inspect.include?('#<Set: {...}>'))
|
assert_equal('#<Set: {#<Set: {0}>, 1, 2, #<Set: {1, 2}>}>', set2.inspect)
|
||||||
|
|
||||||
set1.add(set2)
|
set1.add(set2)
|
||||||
assert_equal(true, set1.inspect.include?('#<Set: {...}>'))
|
assert_equal('#<Set: {#<Set: {0}>, 1, 2, #<Set: {1, 2, #<Set: {...}>}>}>', set2.inspect)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_compare_by_identity
|
def test_compare_by_identity
|
||||||
|
|
Loading…
Reference in a new issue