summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2022-01-30 18:57:52 +0900
committerNARUSE, Yui <naruse@airemix.jp>2022-01-30 19:01:11 +0900
commit20091ccad34904cb5ded13a8787f6662a8e2df68 (patch)
tree2ed0c3645e6663978d8898b9d3f23c74976681d1 /test
parentfb4df44d1670e9d25aef6b235a7281199a177edb (diff)
merge revision(s) 0dc7816c4350683ccd020f5759eee4914de0085d: [Backport #18434]
Make RubyVM::AST.of work with code written in `-e` command-line option [Bug #18434] --- ast.c | 11 +++++++---- test/ruby/test_ast.rb | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-)
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_ast.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index ce0942a6fb..a4edfd3cbe 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -537,4 +537,9 @@ dummy
assert_equal("{ 1 + 2 }", node_proc.source)
assert_equal("def test_keep_script_lines_for_of\n", node_method.source.lines.first)
end
+
+ def test_e_option
+ assert_in_out_err(["-e", "def foo; end; pp RubyVM::AbstractSyntaxTree.of(method(:foo)).type"],
+ "", [":SCOPE"], [])
+ end
end