diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2021-09-18 21:28:35 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2021-09-18 21:28:35 +0900 |
commit | ed9d9cee76ee941c504ccea33c70c0eb5d825813 (patch) | |
tree | 2233a3f509d49be4a3cc40926746dfa5f8d49209 /test | |
parent | 1c07c98229aa16bf13cbd3997d32230d5324b4f2 (diff) | |
download | ruby-ed9d9cee76ee941c504ccea33c70c0eb5d825813.tar.gz |
ast.c: AST.of checks if a given method object is defined in C
[Bug #18178]
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_ast.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 3af67b1495..0b5c41058c 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -231,6 +231,11 @@ class TestAst < Test::Unit::TestCase assert_raise(ArgumentError) { RubyVM::AbstractSyntaxTree.of(method) } end + def test_of_c_method + c = Class.new { attr_reader :foo } + assert_raise(ArgumentError) { RubyVM::AbstractSyntaxTree.of(c.instance_method(:foo)) } + end + def test_scope_local_variables node = RubyVM::AbstractSyntaxTree.parse("_x = 0") lv, _, body = *node.children |