summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index 0678c3ce2b..26aeecb166 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -655,8 +655,8 @@ module Prism
assert_separately(%w[], "#{<<-'begin;'}\n#{<<-'end;'}")
begin;
def compare_eval(source)
- ruby_eval = RubyVM::InstructionSequence.compile(source).eval
- prism_eval = RubyVM::InstructionSequence.compile_prism(source).eval
+ ruby_eval = RubyVM::InstructionSequence.compile("module A; " + source + "; end").eval
+ prism_eval = RubyVM::InstructionSequence.compile_prism("module B; " + source + "; end").eval
assert_equal ruby_eval, prism_eval
end
@@ -673,7 +673,7 @@ module Prism
$VERBOSE = verbose_bak
end
end
- test_prism_eval("a = 1; tap do; { a: }; end")
+ test_prism_eval("a = 1; 1.times do; { a: }; end")
test_prism_eval("a = 1; def foo(a); a; end")
end;
end
@@ -686,6 +686,15 @@ module Prism
# TODO
end
+ ############################################################################
+ # Encoding #
+ ############################################################################
+
+ def test_encoding
+ test_prism_eval('"perĂ²"')
+ test_prism_eval(":perĂ²")
+ end
+
private
def compare_eval(source)