diff options
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r-- | test/ruby/test_syntax.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 05e6de38f5..9b9063c768 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1007,9 +1007,6 @@ eom assert_warn(/literal in condition/) do eval('1 if //') end - assert_warn(/literal in condition/) do - eval('1 if true..false') - end assert_warning(/literal in condition/) do eval('1 if 1') end @@ -1040,6 +1037,27 @@ eom end end + def test_warning_literal_in_flip_flop + assert_warn(/literal in flip-flop/) do + eval('1 if ""..false') + end + assert_warning(/literal in flip-flop/) do + eval('1 if :foo..false') + end + assert_warning(/literal in flip-flop/) do + eval('1 if :"#{"foo".upcase}"..false') + end + assert_warn(/literal in flip-flop/) do + eval('1 if ""...false') + end + assert_warning(/literal in flip-flop/) do + eval('1 if :foo...false') + end + assert_warning(/literal in flip-flop/) do + eval('1 if :"#{"foo".upcase}"...false') + end + end + def test_alias_symbol bug8851 = '[ruby-dev:47681] [Bug #8851]' formats = ['%s', ":'%s'", ':"%s"', '%%s(%s)'] |