diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-10-19 17:50:21 -0300 |
---|---|---|
committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-10-20 16:29:06 -0300 |
commit | 01787d53bfef987a34832ade02376b2f9e364327 (patch) | |
tree | 001968553058e9ddd5ad75244cbc82496a7d76b2 /test | |
parent | fab7018346488a693d34ea81f1e9d6fec476f06e (diff) | |
download | ruby-01787d53bfef987a34832ade02376b2f9e364327.tar.gz |
[PRISM] Setup encodings in prism compiler
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_compile_prism.rb | 15 |
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) |