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
This commit is contained in:
nobu 2018-04-16 06:37:42 +00:00
parent 5bae48bd56
commit 5b2b1130cf
2 changed files with 7 additions and 4 deletions

View file

@ -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