ruby-changes:65630
From: Nobuyoshi <ko1@a...>
Date: Tue, 23 Mar 2021 16:55:31 +0900 (JST)
Subject: [ruby-changes:65630] a58f9aa350 (master): Assertion for colon-separated encoding pragma
https://git.ruby-lang.org/ruby.git/commit/?id=a58f9aa350 From a58f9aa3504f4057950fb858ea54b28d954f947f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 23 Mar 2021 16:44:55 +0900 Subject: Assertion for colon-separated encoding pragma --- test/ruby/test_parse.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 4b7a12c..3f2deab 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -669,6 +669,15 @@ FOO https://github.com/ruby/ruby/blob/trunk/test/ruby/test_parse.rb#L669 def test_magic_comment x = nil + + assert_nothing_raised do + eval <<-END, nil, __FILE__, __LINE__+1 +# coding: utf-8 +x = __ENCODING__ + END + end + assert_equal(Encoding.find("UTF-8"), x) + assert_nothing_raised do eval <<-END, nil, __FILE__, __LINE__+1 # coding = utf-8 -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/