From fe780f29977ccb09c5bce008e9d5bbf245d1cb38 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 27 May 2014 14:06:48 +0000 Subject: parse.y: refine error message * parse.y (parser_number_literal_suffix): refine error message for extra dot and digits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_syntax.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 0847c28bfc..0e8a5ee478 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -426,6 +426,15 @@ eom end end + def test_unexpected_fraction + msg = /unexpected fraction/ + assert_syntax_error("0x0.0", msg) + assert_syntax_error("0b0.0", msg) + assert_syntax_error("0d0.0", msg) + assert_syntax_error("0o0.0", msg) + assert_syntax_error("0.0.0", msg) + end + private def not_label(x) @result = x; @not_label ||= nil end -- cgit v1.2.3