summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2023-10-25 14:14:43 -0300
committerJemma Issroff <jemmaissroff@gmail.com>2023-10-26 07:15:35 -0300
commitd6cb2dc6225dd544ca943e09df755a26324763a5 (patch)
tree254797a89472f29114d8d726ec8dfe7d27b22981 /test/ruby
parent8e5744588f9e04273f4c37268c9954c9174be671 (diff)
[PRISM] Refactor tests to deconflict with existing tests
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb28
1 files changed, 15 insertions, 13 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index 8315ee4e3d..a5907e1e45 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -3,6 +3,8 @@
# This file is organized to match itemization in https://github.com/ruby/prism/issues/1335
module Prism
class TestCompilePrism < Test::Unit::TestCase
+ # Subclass is used for tests which need it
+ class Subclass; end
############################################################################
# Literals #
############################################################################
@@ -599,19 +601,19 @@ module Prism
def test_CallAndWriteNode
test_prism_eval(<<-CODE
- def Object.test_call_and_write_node; end;
- Object.test_call_and_write_node &&= 1
+ def Subclass.test_call_and_write_node; end;
+ Subclass.test_call_and_write_node &&= 1
CODE
)
test_prism_eval(<<-CODE
- def Object.test_call_and_write_node
+ def Subclass.test_call_and_write_node
"str"
end
- def Object.test_call_and_write_node=(val)
+ def Subclass.test_call_and_write_node=(val)
val
end
- Object.test_call_and_write_node &&= 1
+ Subclass.test_call_and_write_node &&= 1
CODE
)
@@ -635,19 +637,19 @@ module Prism
def test_CallOrWriteNode
test_prism_eval(<<-CODE
- def Object.test_call_or_write_node; end;
- def Object.test_call_or_write_node=(val)
+ def Subclass.test_call_or_write_node; end;
+ def Subclass.test_call_or_write_node=(val)
val
end
- Object.test_call_or_write_node ||= 1
+ Subclass.test_call_or_write_node ||= 1
CODE
)
test_prism_eval(<<-CODE
- def Object.test_call_or_write_node
+ def Subclass.test_call_or_write_node
"str"
end
- Object.test_call_or_write_node ||= 1
+ Subclass.test_call_or_write_node ||= 1
CODE
)
@@ -671,13 +673,13 @@ module Prism
def test_CallOperatorWriteNode
test_prism_eval(<<-CODE
- def Object.test_call_operator_write_node
+ def Subclass.test_call_operator_write_node
2
end
- def Object.test_call_operator_write_node=(val)
+ def Subclass.test_call_operator_write_node=(val)
val
end
- Object.test_call_operator_write_node += 1
+ Subclass.test_call_operator_write_node += 1
CODE
)
end