diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-02-14 17:30:04 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-02-15 13:39:33 +0900 |
| commit | c57880e68d142e518e231b8e76d595ddd403676d (patch) | |
| tree | 57b53222ae8e90d06bfd75db703aa8f1295b722d /test/ruby | |
| parent | beeee548803f0c8505f7f0f74f020e24fe6ab010 (diff) | |
Show the invalid source encoding in messages
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_parse.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index edf61db325..325519fd80 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -797,6 +797,20 @@ x = __ENCODING__ x = __ENCODING__ END end + + e = assert_raise(ArgumentError) do + eval <<-END, nil, __FILE__, __LINE__+1 +# coding: foo + END + end + assert_include(e.message, "# coding: foo\n ^~~") + + e = assert_raise(ArgumentError) do + eval <<-END, nil, __FILE__, __LINE__+1 +# coding = foo + END + end + assert_include(e.message, "# coding = foo\n ^~~") end def test_utf8_bom |
