summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-05 02:36:58 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-05 02:36:58 +0000
commita2643fb4c457cf208c3625c831d6cab715059f03 (patch)
tree72c3c0f403662bfe3d7a45b37cb1a2981b043641 /test
parent0c769b714072a8d2aa9b31d1e96cdfaea64f75a5 (diff)
merges r25209 from trunk into ruby_1_9_1.
-- * parse.y (bv_decls, bvar): fix for block variables. [ruby-dev:39423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ripper/test_parser_events.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 4a4854b28a..80199ecce5 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1,6 +1,7 @@
begin
require_relative 'dummyparser'
+require_relative '../ruby/envutil'
require 'test/unit'
class TestRipper_ParserEvents < Test::Unit::TestCase
@@ -566,6 +567,15 @@ class TestRipper_ParserEvents < Test::Unit::TestCase
assert_equal("[fcall(p,[],&block([w],[#{div}]))]", parse("p{|w|w /25 # /\n}"), bug1939)
assert_equal("[def(p,[w],bodystmt([#{div}]))]", parse("def p(w)\nw /25 # /\nend"), bug1939)
end
+
+ def test_block_variables
+ assert_equal("[fcall(proc,[],&block([],[void()]))]", parse("proc{|;y|}"))
+ if defined?(Process::RLIMIT_AS)
+ assert_in_out_err(["-I#{File.dirname(__FILE__)}", "-rdummyparser"],
+ 'Process.setrlimit(Process::RLIMIT_AS,102400); puts DummyParser.new("proc{|;y|}").parse',
+ ["[fcall(proc,[],&block([],[void()]))]"], [], '[ruby-dev:39423]')
+ end
+ end
end
rescue LoadError