diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-09 00:20:57 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-09 00:20:57 +0000 |
commit | 277d1f50bb04b9c8f84311ba8de6568dd3347e36 (patch) | |
tree | 58747bfd08ca61188310e19ea749ff45669d3de0 /test | |
parent | 3a4d8ba95f65f258674819bf0a6f86238ee853e2 (diff) | |
parent | e7209358b946493310abc3c4178b945b26b80bcf (diff) |
add tag v2_4_0_preview2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v2_4_0_preview2@56114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_array.rb | 18 | ||||
-rw-r--r-- | test/ruby/test_refinement.rb | 16 |
2 files changed, 26 insertions, 8 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index addce0d9ba..a19e22aab4 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -813,6 +813,15 @@ class TestArray < Test::Unit::TestCase assert_nothing_raised(RuntimeError, bug10748) {a.flatten(1)} end + def test_flattern_singleton_class + bug12738 = '[ruby-dev:49781] [Bug #12738]' + a = [[0]] + class << a + def m; end + end + assert_raise(NoMethodError, bug12738) { a.flatten.m } + end + def test_flatten! a1 = @cls[ 1, 2, 3] a2 = @cls[ 5, 6 ] @@ -850,6 +859,15 @@ class TestArray < Test::Unit::TestCase assert_nothing_raised(RuntimeError, bug10748) {a.flatten!(1)} end + def test_flattern_singleton_class! + bug12738 = '[ruby-dev:49781] [Bug #12738]' + a = [[0]] + class << a + def m; end + end + assert_nothing_raised(NameError, bug12738) { a.flatten!.m } + end + def test_flatten_with_callcc need_continuation o = Object.new diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 5980280235..c3c2dbc61f 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1651,27 +1651,27 @@ class TestRefinement < Test::Unit::TestCase module Foo using RefB - USED_REFS = Module.used_refinements + USED_MODS = Module.used_modules end module Bar using RefC - USED_REFS = Module.used_refinements + USED_MODS = Module.used_modules end module Combined using RefA using RefB - USED_REFS = Module.used_refinements + USED_MODS = Module.used_modules end end - def test_used_refinements + def test_used_modules ref = VisibleRefinements - assert_equal [], Module.used_refinements - assert_equal [ref::RefB], ref::Foo::USED_REFS - assert_equal [ref::RefC], ref::Bar::USED_REFS - assert_equal [ref::RefB, ref::RefA], ref::Combined::USED_REFS + assert_equal [], Module.used_modules + assert_equal [ref::RefB], ref::Foo::USED_MODS + assert_equal [ref::RefC], ref::Bar::USED_MODS + assert_equal [ref::RefB, ref::RefA], ref::Combined::USED_MODS end def test_warn_setconst_in_refinmenet |