summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-12 22:13:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-12 22:13:09 +0000
commita3a5f38d09042b86a4026ebbdf7f61d413da341f (patch)
treee9e463929122c3d39b8c787170c02ad7965736d6 /test/ruby
parent2625c6a761e694e7fe62d334b77e4d925e546d19 (diff)
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
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_rubyoptions.rb6
1 files changed, 3 insertions, 3 deletions
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"]