From ba0fd3b2fd15a2257714dd4c0278fd951bacf966 Mon Sep 17 00:00:00 2001 From: nahi Date: Tue, 7 Oct 2003 06:27:11 +0000 Subject: * test/ruby/test_beginendblock.rb: add tests for nested BEGIN/END. * test/ruby/beginmainend.rb: add tests for nested BEGIN/END. * test/ruby/endblockwarn.rb: new file added to test of END-in-method warning. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/endblockwarn.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/ruby/endblockwarn.rb (limited to 'test/ruby/endblockwarn.rb') diff --git a/test/ruby/endblockwarn.rb b/test/ruby/endblockwarn.rb new file mode 100644 index 000000000..8da5c241e --- /dev/null +++ b/test/ruby/endblockwarn.rb @@ -0,0 +1,26 @@ +BEGIN { + if errout = ARGV.shift + dir = File.dirname(File.expand_path(__FILE__)) + basename = File.basename(__FILE__) + require "#{dir}/envutil" + STDERR.reopen(File.open(errout, "w")) + STDERR.sync = true + Dir.chdir(dir) + cmd = "\"#{EnvUtil.rubybin}\" \"#{basename}\"" + exec(cmd) + exit!("must not reach here") + end +} + +def end1 + END {} +end + +end1 + +eval <