diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-29 16:58:21 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-29 16:58:21 +0900 |
commit | abe12d8b96be3c12618811f22ca01788366f99f8 (patch) | |
tree | 53a6dca2fb22399795684a67d7345f768441ee8f /test | |
parent | 2ed68d0ff9a932efbc4393c869534040dec8f647 (diff) | |
download | ruby-abe12d8b96be3c12618811f22ca01788366f99f8.tar.gz |
Freeze method reference operator object
[Feature #16103]
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_method.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index ba425a4517..acaf43e46c 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -1120,16 +1120,20 @@ class TestMethod < Test::Unit::TestCase def test_method_reference_operator m = 1.:succ + assert_predicate(m, :frozen?) assert_equal(1.method(:succ), m) assert_equal(2, m.()) m = 1.:+ + assert_predicate(m, :frozen?) assert_equal(1.method(:+), m) assert_equal(42, m.(41)) m = 1.:-@ + assert_predicate(m, :frozen?) assert_equal(1.method(:-@), m) assert_equal(-1, m.()) o = Object.new def o.foo; 42; end + assert_predicate(o.:foo, :frozen?) m = o.method(:foo) assert_equal(m, o.:foo) def o.method(m); nil; end |