diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-24 11:43:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-24 11:43:11 +0000 |
commit | 7e68efbc9599550eadf5aa9a50bdc9a36796db49 (patch) | |
tree | eb1ae7ba3950cac932fb817482e80e252cba082e /test/ruby | |
parent | c6fb7c1f33e128618bcd7799a2de52874c7ebdd8 (diff) |
parse.y: remove an extra error message
* parse.y (parse_string): bail out when word-list meets end of
input not to show an extra "unexpected" error message after the
preceding error.
$ ruby -e "%w["
-e:1: unterminated string meets end of file
-e:1: syntax error, unexpected terminator, expecting ' '
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_parse.rb | 1 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 1345dabc6e..ea5065960a 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -351,6 +351,7 @@ class TestParse < Test::Unit::TestCase def test_words assert_equal([], %W( )) + assert_syntax_error('%w[abc', /unterminated list/) end def test_dstr diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 3d8f6fb72a..5c1bd8fc16 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -888,8 +888,8 @@ eom bug10957 = '[ruby-core:68477] [Bug #10957]' assert_ruby_status(['-c', '-e', 'p ()..0'], "", bug10957) assert_ruby_status(['-c', '-e', 'p ()...0'], "", bug10957) - assert_syntax_error('0..%w.', /unterminated string/, bug10957) - assert_syntax_error('0...%w.', /unterminated string/, bug10957) + assert_syntax_error('0..%q.', /unterminated string/, bug10957) + assert_syntax_error('0...%q.', /unterminated string/, bug10957) end def test_too_big_nth_ref |