Remove cname duplication from exc_inspect().

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-03-19 08:03:39 +09:00
parent e6b5c75ec5
commit 8d1468eab4
2 changed files with 2 additions and 5 deletions
+1 -4
View File
@@ -166,13 +166,10 @@ exc_inspect(mrb_state *mrb, mrb_value exc)
else {
const char *cname = mrb_obj_classname(mrb, exc);
str = mrb_str_new_cstr(mrb, cname);
mrb_str_cat_lit(mrb, str, ": ");
if (append_mesg) {
mrb_str_cat_lit(mrb, str, ": ");
mrb_str_cat_str(mrb, str, mesg);
}
else {
mrb_str_cat_cstr(mrb, str, cname);
}
}
return str;
}
+1 -1
View File
@@ -353,7 +353,7 @@ assert('Exception 19') do
end
assert('Exception#inspect without message') do
assert_equal "Exception: Exception", Exception.new.inspect
assert_equal "Exception", Exception.new.inspect
end
assert('Exception#backtrace') do