From cd8d08b5329fd86660cced8a5b91c4a042f2e2a0 Mon Sep 17 00:00:00 2001 From: nahi Date: Tue, 7 Oct 2003 06:27:11 +0000 Subject: [PATCH] * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@4716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 ++++++ test/ruby/beginmainend.rb | 50 ++++++++++++++++++++++++++------- test/ruby/endblockwarn.rb | 26 +++++++++++++++++ test/ruby/test_beginendblock.rb | 48 +++++++++++++++++++++++++------ test/ruby/test_float.rb | 5 ++++ 5 files changed, 119 insertions(+), 19 deletions(-) create mode 100644 test/ruby/endblockwarn.rb diff --git a/ChangeLog b/ChangeLog index a228542431..dd8b2789b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Oct 7 15:23:09 2003 NAKAMURA, Hiroshi + + * 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. + Tue Oct 7 12:23:47 2003 Tanaka Akira * ext/fcntl/fcntl.c (Init_fcntl): define Fcntl::O_ACCMODE. diff --git a/test/ruby/beginmainend.rb b/test/ruby/beginmainend.rb index 4710a7aeb1..f096b96fbc 100644 --- a/test/ruby/beginmainend.rb +++ b/test/ruby/beginmainend.rb @@ -1,25 +1,31 @@ +errout = ARGV.shift + BEGIN { - puts "begin1" + puts "b1" local_begin1 = "local_begin1" $global_begin1 = "global_begin1" ConstBegin1 = "ConstBegin1" } BEGIN { - puts "begin2" + puts "b2" + + BEGIN { + puts "b2-1" + } } # for scope check raise if defined?(local_begin1) raise unless defined?($global_begin1) raise unless defined?(::ConstBegin1) -local_for_end2 = "end2" -$global_for_end1 = "end1" +local_for_end2 = "e2" +$global_for_end1 = "e1" puts "main" END { - puts local_for_end2 + puts local_for_end2 # e2 } END { @@ -29,27 +35,51 @@ END { eval <