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 <