diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-22 00:32:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-22 00:45:05 +0900 |
commit | 8c5ca318cbe57269f144a4d0822c5283c1fd4e1a (patch) | |
tree | 8affdb4955703701e4b9ee9bf0ed6bc0c42da5a3 /test | |
parent | 5cab86f3b0725457be3c50d3cab43b04bea53290 (diff) | |
download | ruby-8c5ca318cbe57269f144a4d0822c5283c1fd4e1a.tar.gz |
`Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260]
With refinements, too.
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_symbol.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 2e9710e4dc..632acb3e3d 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -169,6 +169,9 @@ class TestSymbol < Test::Unit::TestCase def _test_to_proc_arg_with_refinements_call(&block) block.call TestToPRocArgWithRefinements.new end + def _test_to_proc_with_refinements_call(&block) + block + end using Module.new { refine TestToPRocArgWithRefinements do def hoge @@ -180,6 +183,10 @@ class TestSymbol < Test::Unit::TestCase assert_equal(:hoge, _test_to_proc_arg_with_refinements_call(&:hoge)) end + def test_to_proc_lambda_with_refinements + assert_predicate(_test_to_proc_with_refinements_call(&:hoge), :lambda?) + end + def self._test_to_proc_arg_with_refinements_call(&block) block.call TestToPRocArgWithRefinements.new end |