We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aac272e commit d1cff2fCopy full SHA for d1cff2f
1 file changed
test/prism/result/error_recovery_test.rb
@@ -92,6 +92,15 @@ def test_interpolated_string_node_parts_interpolated_xstring
92
assert node.parts.any? { |part| part.is_a?(ErrorRecoveryNode) && part.child.is_a?(InterpolatedXStringNode) }
93
end
94
95
+ def test_module_node_constant_path_def
96
+ result = Prism.parse("module def foo; end")
97
+ refute result.success?
98
+
99
+ node = result.value.statements.body.first
100
+ assert_kind_of ErrorRecoveryNode, node.constant_path
101
+ assert_kind_of DefNode, node.constant_path.child
102
+ end
103
104
def test_module_node_constant_path_missing
105
result = Prism.parse("module Parent module end")
106
refute result.success?
0 commit comments