From a3a5f38d09042b86a4026ebbdf7f61d413da341f Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 12 Apr 2018 22:13:09 +0000 Subject: parse.y: `when` indent * parse.y (k_when): warn less-indented `when` than `case`. [ruby-core:86492] [Bug #14674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_rubyoptions.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 0f608cd8a5..ddfd5f1883 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -450,13 +450,13 @@ class TestRubyOptions < Test::Unit::TestCase ["begin", "rescue ; end"], ["begin rescue", "else ; end"], ["begin", "ensure ; end"], - ["case nil", "when true; end"], + [" case nil", "when true; end"], ["case nil; when true", "end"], ].each do |b, e = 'end'| src = ["#{b}\n", " #{e}\n"] - k = b[/\A\S+/] - e = e[/\A\S+/] + k = b[/\A\s*(\S+)/, 1] + e = e[/\A\s*(\S+)/, 1] a.for("no directives with #{b}") do err = ["#{t.path}:2: warning: mismatched indentations at '#{e}' with '#{k}' at 1"] -- cgit v1.2.3