From 5b2b1130cf7beadedb7176e44b356f157f5a8838 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 16 Apr 2018 06:37:42 +0000 Subject: string.c: fix checking order * string.c (str_undump): check for suffix before if Unicode escape conflicts with it. the message "but used force_encoding" sounds strange when it is not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index fee71791a1..d6356fcfa1 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -814,6 +814,9 @@ CODE assert_raise(RuntimeError) { S('"\xA"').undump } assert_raise(RuntimeError) { S('"\\"').undump } assert_raise(RuntimeError) { S(%("\0")).undump } + assert_raise_with_message(RuntimeError, /invalid/) { + '"\\u{007F}".xxxxxx'.undump + } end def test_dup -- cgit v1.2.3