diff options
| author | Adam Hess <adamhess1991@gmail.com> | 2024-01-18 15:18:14 -0800 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-01-19 22:57:45 +0000 |
| commit | cfabe9c51cfa11f4020de119aa2bc707db15cf89 (patch) | |
| tree | ade39caa740b3a96266649d8d32ddc3fd98ff59b /test | |
| parent | ed50161bd6dd27da21bd18c37b1a52d47c82a997 (diff) | |
[ruby/prism] Handle stovetop start in constant path fullname
https://github.com/ruby/prism/commit/3a216e63fe
Diffstat (limited to 'test')
| -rw-r--r-- | test/prism/constant_path_node_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/prism/constant_path_node_test.rb b/test/prism/constant_path_node_test.rb index 9842be0c49..aeab6e01e9 100644 --- a/test/prism/constant_path_node_test.rb +++ b/test/prism/constant_path_node_test.rb @@ -52,5 +52,16 @@ module Prism node = Prism.parse(source).value.statements.body.first assert_equal("Foo::Bar::Baz::Qux", node.lefts.first.full_name) end + + def test_full_name_for_constant_path_with_stovetop_start + source = <<~RUBY + ::Foo:: # comment + Bar::Baz:: + Qux, Something = [1, 2] + RUBY + + node = Prism.parse(source).value.statements.body.first + assert_equal("::Foo::Bar::Baz::Qux", node.lefts.first.full_name) + end end end |
