summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-14 08:46:10 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-14 08:46:10 +0000
commitcb1d634d6acd6a7171c146115e9d44bc9e55e3b6 (patch)
tree13ec44b4707b1f9629fdcfca0098b0d68b20abd4
parent7eb444d9a38f95ded3308d30e5de02337bb117e5 (diff)
Make tests for Set#inspect more straightforward
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/test_set.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/test_set.rb b/test/test_set.rb
index 07c404a..5774af7 100644
--- a/test/test_set.rb
+++ b/test/test_set.rb
@@ -705,15 +705,14 @@ class TC_Set < Test::Unit::TestCase
end
def test_inspect
- set1 = Set[1]
-
- assert_equal('#<Set: {1}>', set1.inspect)
+ set1 = Set[1, 2]
+ assert_equal('#<Set: {1, 2}>', set1.inspect)
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)
- assert_equal(true, set1.inspect.include?('#<Set: {...}>'))
+ assert_equal('#<Set: {#<Set: {0}>, 1, 2, #<Set: {1, 2, #<Set: {...}>}>}>', set2.inspect)
end
def test_compare_by_identity