diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-20 13:50:14 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-20 13:50:14 +0000 |
| commit | 53041ad564a7269c0daae0e7b5a34d89f95de50e (patch) | |
| tree | db831a89549aa2dfc3700e769b59f74dfb892ff5 /test/ruby | |
| parent | 2ec4f0e6428f116cae81fb6476141eb10ff56ed9 (diff) | |
| download | ruby-53041ad564a7269c0daae0e7b5a34d89f95de50e.tar.gz ruby-53041ad564a7269c0daae0e7b5a34d89f95de50e.tar.xz ruby-53041ad564a7269c0daae0e7b5a34d89f95de50e.zip | |
* compile.c (iseq_compile_each): NODE_POSTEXE should set each end
procs only once. [ruby-dev:35596]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_beginendblock.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb index f75311f3b..594596698 100644 --- a/test/ruby/test_beginendblock.rb +++ b/test/ruby/test_beginendblock.rb @@ -14,6 +14,21 @@ class TestBeginEndBlock < Test::Unit::TestCase target = File.join(DIR, 'beginmainend.rb') result = IO.popen([ruby, target]){|io|io.read} assert_equal(%w(b1 b2-1 b2 main b3-1 b3 b4 e1 e4 e3 e2 e4-2 e4-1 e1-1 e4-1-1), result.split) + + input = Tempfile.new(self.class.name) + inputpath = input.path + input.close + result = IO.popen([ruby, "-n", "-eBEGIN{p :begin}", "-eEND{p :end}", inputpath]){|io|io.read} + assert_equal(%w(:begin), result.split) + result = IO.popen([ruby, "-p", "-eBEGIN{p :begin}", "-eEND{p :end}", inputpath]){|io|io.read} + assert_equal(%w(:begin), result.split) + input.open + input.puts "foo\nbar" + input.close + result = IO.popen([ruby, "-n", "-eBEGIN{p :begin}", "-eEND{p :end}", inputpath]){|io|io.read} + assert_equal(%w(:begin :end), result.split) + result = IO.popen([ruby, "-p", "-eBEGIN{p :begin}", "-eEND{p :end}", inputpath]){|io|io.read} + assert_equal(%w(:begin foo bar :end), result.split) end def test_begininmethod |
