diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-26 13:43:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-26 13:43:32 +0000 |
commit | 60023cf4521ce86803b9d328982e679962d448cc (patch) | |
tree | 0f2025a0870e85a02675146729d119553626a6e5 /test/ruby | |
parent | 0a5b4c13ad16bacfa5659f7ac92eb7abf9416261 (diff) | |
download | ruby-60023cf4521ce86803b9d328982e679962d448cc.tar.gz |
parse.y: trim newline in erred code
* parse.y (parser_yyerror): trim a newline at the end of the erred
code which was replaced with an extra space in the succeeding
cursor line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_syntax.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 5c1bd8fc16..c28bc80bc0 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1142,6 +1142,12 @@ eom end; end + def test_syntax_error_at_newline + expected = "\n ^" + assert_syntax_error("%[abcdef", expected) + assert_syntax_error("%[abcdef\n", expected) + end + def test_invalid_jump assert_in_out_err(%w[-e redo], "", [], /^-e:1: /) end |