diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2021-12-26 19:41:42 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2021-12-26 20:57:34 +0900 |
commit | 0dc7816c4350683ccd020f5759eee4914de0085d (patch) | |
tree | 614d8e996e15667637a1477a7d3b8d1a1ded54eb /test | |
parent | 18da9359de08748fe83e7a6288110c847666ae25 (diff) |
Make RubyVM::AST.of work with code written in `-e` command-line option
[Bug #18434]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5347
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 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 |