mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 06:56:13 +02:00
[ruby/prism] Handle stovetop start in constant path fullname
3a216e63fe
This commit is contained in:
parent
ed50161bd6
commit
cfabe9c51c
2 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue