aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-17 11:56:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-17 11:56:55 +0000
commit6f68d8b4b1200ef809e05d5742e4f91301084d14 (patch)
treed0b16653fbb2b6976ef486438408d1fe78fb7b43 /test/ruby/test_syntax.rb
parent0bbff9d92ce8bd84ad9273c64965bdbf9747eff1 (diff)
downloadruby-6f68d8b4b1200ef809e05d5742e4f91301084d14.tar.gz
parse.y: fix block after conditional
* parse.y: fix syntax error at do-block after a conditional operator. separate label-allowed and after-a-label states from others as bit flags. [ruby-dev:48790] [Bug #10653] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 158c12d9b6..c457e2d3a4 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -304,6 +304,12 @@ WARN
assert_syntax_error("{%q'a': 1}", /unexpected ':'/)
end
+ def test_block_after_cond
+ bug10653 = '[ruby-dev:48790] [Bug #10653]'
+ assert_valid_syntax("false ? raise {} : tap {}", bug10653)
+ assert_valid_syntax("false ? raise do end : tap do end", bug10653)
+ end
+
def test_duplicated_arg
assert_syntax_error("def foo(a, a) end", /duplicated argument name/)
assert_nothing_raised { def foo(_, _) end }