mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_trick.rb: Make the encoding explicit for code written in UTF-8
This commit is contained in:
parent
67fe290bb3
commit
caae14d90b
1 changed files with 2 additions and 2 deletions
|
@ -154,7 +154,7 @@ class TestTRICK2018 < Test::Unit::TestCase
|
||||||
def test_04_colin
|
def test_04_colin
|
||||||
src = File.join(__dir__, "../sample/trick2018/04-colin/entry.rb")
|
src = File.join(__dir__, "../sample/trick2018/04-colin/entry.rb")
|
||||||
|
|
||||||
code = "# encoding: UTF-8\n" + File.read(src) + <<END
|
code = "# encoding: UTF-8\n" + File.read(src, encoding: "UTF-8") + <<END
|
||||||
\u{1F914} "Math" do
|
\u{1F914} "Math" do
|
||||||
\u{1F914} "Addition" do
|
\u{1F914} "Addition" do
|
||||||
\u{1F914} "One plus one equals two.",
|
\u{1F914} "One plus one equals two.",
|
||||||
|
@ -171,7 +171,7 @@ class TestTRICK2018 < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
END
|
END
|
||||||
assert_in_out_err(["-W0"], code, <<END.lines(chomp: true))
|
assert_in_out_err(["-W0"], code, <<END.lines(chomp: true), encoding: "UTF-8")
|
||||||
Math
|
Math
|
||||||
Addition
|
Addition
|
||||||
One plus one equals two.
|
One plus one equals two.
|
||||||
|
|
Loading…
Add table
Reference in a new issue