From f96f013955b2e804be3bf63011cbbb3f132b5349 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 25 Jun 2014 17:45:10 +0000 Subject: [PATCH] eval_error.c: newline always * eval_error.c (error_print): put a newline after an anonymous exception class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ eval_error.c | 2 +- test/ruby/test_exception.rb | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d8bd162618..eca3a3cd78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 26 02:45:04 2014 Nobuyoshi Nakada + + * eval_error.c (error_print): put a newline after an anonymous + exception class name. + Wed Jun 25 22:31:32 2014 Nobuyoshi Nakada * hash.c (ruby_setenv): fix memory leak on Windows, free diff --git a/eval_error.c b/eval_error.c index c6a1252ef9..401eba8c54 100644 --- a/eval_error.c +++ b/eval_error.c @@ -170,8 +170,8 @@ error_print(void) } if (tail) { warn_print2(tail, elen - len - 1); - if (einfo[elen-1] != '\n') warn_print2("\n", 1); } + if (tail ? einfo[elen-1] != '\n' : !epath) warn_print2("\n", 1); } } diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index a92050c1d3..c71c7dfc64 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -618,4 +618,8 @@ end.join e = assert_raise(exc, bug) {raise exc, {}} assert_equal({}, e.arg, bug) end + + def test_anonymous_message + assert_in_out_err([], "raise Class.new(RuntimeError), 'foo'", [], /foo\n/) + end end