mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* error.c (name_err_mesg_to_str): preserve encoding of inspection.
[ruby-core:29948] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
16c40ec1a5
commit
e8249be9fc
3 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue May 4 18:51:22 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* error.c (name_err_mesg_to_str): preserve encoding of inspection.
|
||||
[ruby-core:29948]
|
||||
|
||||
Tue May 4 18:38:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* test/fileutils/test_fileutils.rb (test_copy_stream):
|
||||
|
|
2
error.c
2
error.c
|
@ -880,7 +880,7 @@ name_err_mesg_to_str(VALUE obj)
|
|||
break;
|
||||
}
|
||||
if (desc && desc[0] != '#') {
|
||||
d = rb_str_new2(desc);
|
||||
d = d ? rb_str_dup(d) : rb_str_new2(desc);
|
||||
rb_str_cat2(d, ":");
|
||||
rb_str_cat2(d, rb_obj_classname(obj));
|
||||
}
|
||||
|
|
|
@ -304,4 +304,12 @@ end.join
|
|||
end
|
||||
assert(!e.success?)
|
||||
end
|
||||
|
||||
def test_nomethoderror
|
||||
bug3237 = '[ruby-core:29948]'
|
||||
str = "\u2600"
|
||||
id = :"\u2604"
|
||||
e = assert_raise(NoMethodError) {str.__send__(id)}
|
||||
assert_equal("undefined method `#{id}' for #{str.inspect}:String", e.message, bug3237)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue