[前][次][番号順一覧][スレッド一覧]

ruby-changes:47216

From: knu <ko1@a...>
Date: Fri, 14 Jul 2017 17:46:16 +0900 (JST)
Subject: [ruby-changes:47216] knu:r59331 (trunk): Make tests for Set#inspect more straightforward

knu	2017-07-14 17:46:10 +0900 (Fri, 14 Jul 2017)

  New Revision: 59331

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59331

  Log:
    Make tests for Set#inspect more straightforward

  Modified files:
    trunk/test/test_set.rb
Index: test/test_set.rb
===================================================================
--- test/test_set.rb	(revision 59330)
+++ test/test_set.rb	(revision 59331)
@@ -705,15 +705,14 @@ class TC_Set < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_set.rb#L705
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]