[ruby/prism] Handle stovetop start in constant path fullname

3a216e63fe
This commit is contained in:
Adam Hess 2024-01-18 15:18:14 -08:00 committed by git
parent ed50161bd6
commit cfabe9c51c
2 changed files with 12 additions and 1 deletions

View file

@ -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