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

ruby-changes:44717

From: headius <ko1@a...>
Date: Tue, 15 Nov 2016 04:27:30 +0900 (JST)
Subject: [ruby-changes:44717] headius:r56790 (trunk): * test/ruby/test_module.rb: Method tables are not guaranteed to be

headius	2016-11-15 04:27:24 +0900 (Tue, 15 Nov 2016)

  New Revision: 56790

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

  Log:
    * test/ruby/test_module.rb: Method tables are not guaranteed to be
      ordered.
    * test/ruby/test_struct.rb: Ditto.
    * test/ruby/test_thread.rb: Thread locals are not guaranteed to be
    ordered.

  Modified files:
    trunk/test/ruby/test_module.rb
    trunk/test/ruby/test_struct.rb
    trunk/test/ruby/test_thread.rb
Index: test/ruby/test_module.rb
===================================================================
--- test/ruby/test_module.rb	(revision 56789)
+++ test/ruby/test_module.rb	(revision 56790)
@@ -455,7 +455,7 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L455
   end
 
   def test_instance_methods
-    assert_equal([:user, :user2], User.instance_methods(false))
+    assert_equal([:user, :user2], User.instance_methods(false).sort)
     assert_equal([:user, :user2, :mixin].sort, User.instance_methods(true).sort)
     assert_equal([:mixin], Mixin.instance_methods)
     assert_equal([:mixin], Mixin.instance_methods(true))
Index: test/ruby/test_struct.rb
===================================================================
--- test/ruby/test_struct.rb	(revision 56789)
+++ test/ruby/test_struct.rb	(revision 56790)
@@ -147,7 +147,7 @@ module TestStruct https://github.com/ruby/ruby/blob/trunk/test/ruby/test_struct.rb#L147
     assert_equal("#<struct :@a=3>", o.inspect)
 
     methods = klass.instance_methods(false)
-    assert_equal([:@a, :"@a="].inspect, methods.inspect, '[Bug #8756]')
+    assert_equal([:@a, :"@a="].sort.inspect, methods.sort.inspect, '[Bug #8756]')
     assert_include(methods, :@a)
     assert_include(methods, :"@a=")
   end
Index: test/ruby/test_thread.rb
===================================================================
--- test/ruby/test_thread.rb	(revision 56789)
+++ test/ruby/test_thread.rb	(revision 56790)
@@ -476,7 +476,7 @@ class TestThread < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L476
     assert_equal(false, t.key?(:qux))
     assert_equal(false, t.key?("qux"))
 
-    assert_equal([:foo, :bar, :baz], t.keys)
+    assert_equal([:foo, :bar, :baz].sort, t.keys.sort)
 
   ensure
     t.kill if t

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

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