From 39fcd1cdf295d310c1bfd220324fef5b2f725230 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 19 May 2008 05:20:21 +0000 Subject: * bootstraptest/test_knownbug.rb: move solved tests. * bootstraptest/test_eval.rb, test_literal.rb, test_syntax.rb, test_thread.rb: ditto. * test/ruby/test_m17n.rb, test_proc.rb, test_sprintf.rb, test_string.rb, test/ruby/test_struct.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_syntax.rb | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'bootstraptest/test_syntax.rb') diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb index dc4cae3dff..5479de0573 100644 --- a/bootstraptest/test_syntax.rb +++ b/bootstraptest/test_syntax.rb @@ -767,3 +767,53 @@ assert_equal "1\n2\n", %q{ } assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]') + +assert_equal 'ok', %q{ + def a() end + begin + if defined?(a(1).a) + :ng + else + :ok + end + rescue + :ng + end +}, '[ruby-core:16010]' + +assert_equal 'ok', %q{ + def a() end + begin + if defined?(a::B) + :ng + else + :ok + end + rescue + :ng + end +}, '[ruby-core:16010]' + +assert_normal_exit %q{ + defined? C && 0 +} + +assert_normal_exit %q{ + class C + def m + defined?(super()) + end + end + C.new.m +} + +assert_equal 'ok', %q{ + class X < RuntimeError;end + x = [X] + begin + raise X + rescue *x + :ok + end +}, '[ruby-core:14537]' + -- cgit v1.2.3