1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

struct.c: encoding of member name

* struct.c (not_a_member): preserve encoding of member name in
  error messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-03-28 10:32:36 +00:00
parent afb4bcbfd6
commit 4a46362239
2 changed files with 2 additions and 1 deletions

View file

@ -84,7 +84,7 @@ NORETURN(static void not_a_member(ID id));
static void
not_a_member(ID id)
{
rb_name_error(id, "`%s' is not a struct member", rb_id2name(id));
rb_name_error(id, "`%"PRIsVALUE"' is not a struct member", QUOTE_ID(id));
}
VALUE

View file

@ -8,5 +8,6 @@ class Bug::Struct::Test_Member < Test::Unit::TestCase
s = S.new(1)
assert_equal(1, s.get(:a))
assert_raise_with_message(NameError, /is not a struct member/) {s.get(:b)}
assert_raise_with_message(NameError, /\u{3042}/) {s.get(:"\u{3042}")}
end
end