summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-24 16:10:59 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-24 16:12:17 +0900
commit2893550452f6f3cadb17c670da185813d7d0a835 (patch)
treea19bc3bd37f155cb2155fc1311f85fa851f77b55 /test/ruby/test_syntax.rb
parent45ad375acccca2bb0852613b1e809a7af556f5e6 (diff)
downloadruby-2893550452f6f3cadb17c670da185813d7d0a835.tar.gz
Mixed encoding error can continue to parse
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 7bf1e0e43c..e640262d90 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -775,32 +775,39 @@ eom
end
def test_heredoc_mixed_encoding
- assert_syntax_error(<<-'HEREDOC', 'UTF-8 mixed within Windows-31J source')
+ e = assert_syntax_error(<<-'HEREDOC', 'UTF-8 mixed within Windows-31J source')
#encoding: cp932
<<-TEXT
\xe9\x9d\u1234
TEXT
HEREDOC
- assert_syntax_error(<<-'HEREDOC', 'UTF-8 mixed within Windows-31J source')
+ assert_not_match(/end-of-input/, e.message)
+
+ e = assert_syntax_error(<<-'HEREDOC', 'UTF-8 mixed within Windows-31J source')
#encoding: cp932
<<-TEXT
\xe9\x9d
\u1234
TEXT
HEREDOC
- assert_syntax_error(<<-'HEREDOC', 'UTF-8 mixed within Windows-31J source')
+ assert_not_match(/end-of-input/, e.message)
+
+ e = assert_syntax_error(<<-'HEREDOC', 'UTF-8 mixed within Windows-31J source')
#encoding: cp932
<<-TEXT
\u1234\xe9\x9d
TEXT
HEREDOC
- assert_syntax_error(<<-'HEREDOC', 'UTF-8 mixed within Windows-31J source')
+ assert_not_match(/end-of-input/, e.message)
+
+ e = assert_syntax_error(<<-'HEREDOC', 'UTF-8 mixed within Windows-31J source')
#encoding: cp932
<<-TEXT
\u1234
\xe9\x9d
TEXT
HEREDOC
+ assert_not_match(/end-of-input/, e.message)
end
def test_lineno_operation_brace_block