Permalink
Browse files

Remove cname duplication from exc_inspect().

  • Loading branch information...
matz committed Mar 18, 2017
1 parent e6b5c75 commit 8d1468eab456a21bbd7a8e8a6a9b87f27fa69062
Showing with 2 additions and 5 deletions.
  1. +1 −4 src/error.c
  2. +1 −1 test/t/exception.rb
View
@@ -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;
}
View
@@ -353,7 +353,7 @@ def z
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

0 comments on commit 8d1468e

Please sign in to comment.