summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2023-11-02 15:07:00 -0300
committerJemma Issroff <jemmaissroff@gmail.com>2023-11-02 17:46:43 -0300
commitd8bdb15a8b0da0d4ff2338bbb8087fbeb0a17b27 (patch)
treeba28236ef99e305cafe0ad1d193c54273b2faf3b /test/ruby
parent5acced49c2cd9309bcd92f38542e79eb0af87dd1 (diff)
[PRISM] Fix popped for Call{And,Or}WriteNode
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb32
1 files changed, 15 insertions, 17 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index 8cf84a7c94..bc05214ffa 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -699,21 +699,21 @@ module Prism
end
def test_CallAndWriteNode
-=begin
assert_prism_eval(<<-CODE
- def Subclass.test_call_and_write_node; end;
- Subclass.test_call_and_write_node &&= 1
+ class PrismTestSubclass; end
+ def PrismTestSubclass.test_call_and_write_node; end;
+ PrismTestSubclass.test_call_and_write_node &&= 1
CODE
)
assert_prism_eval(<<-CODE
- def Subclass.test_call_and_write_node
+ def PrismTestSubclass.test_call_and_write_node
"str"
end
- def Subclass.test_call_and_write_node=(val)
+ def PrismTestSubclass.test_call_and_write_node=(val)
val
end
- Subclass.test_call_and_write_node &&= 1
+ PrismTestSubclass.test_call_and_write_node &&= 1
CODE
)
@@ -733,25 +733,24 @@ module Prism
self.test_call_and_write_node &&= 1
CODE
)
-=end
end
def test_CallOrWriteNode
-=begin
assert_prism_eval(<<-CODE
- def Subclass.test_call_or_write_node; end;
- def Subclass.test_call_or_write_node=(val)
+ class PrismTestSubclass; end
+ def PrismTestSubclass.test_call_or_write_node; end;
+ def PrismTestSubclass.test_call_or_write_node=(val)
val
end
- Subclass.test_call_or_write_node ||= 1
+ PrismTestSubclass.test_call_or_write_node ||= 1
CODE
)
assert_prism_eval(<<-CODE
- def Subclass.test_call_or_write_node
+ def PrismTestSubclass.test_call_or_write_node
"str"
end
- Subclass.test_call_or_write_node ||= 1
+ PrismTestSubclass.test_call_or_write_node ||= 1
CODE
)
@@ -771,19 +770,18 @@ module Prism
self.test_call_or_write_node ||= 1
CODE
)
-=end
end
def test_CallOperatorWriteNode
=begin
assert_prism_eval(<<-CODE
- def Subclass.test_call_operator_write_node
+ def PrismTestSubclass.test_call_operator_write_node
2
end
- def Subclass.test_call_operator_write_node=(val)
+ def PrismTestSubclass.test_call_operator_write_node=(val)
val
end
- Subclass.test_call_operator_write_node += 1
+ PrismTestSubclass.test_call_operator_write_node += 1
CODE
)
=end