summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-19 05:20:21 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-19 05:20:21 +0000
commit39fcd1cdf295d310c1bfd220324fef5b2f725230 (patch)
tree55cf3c7f4e7a02a3e8a4f44b5041463132043376 /bootstraptest
parent888c93593003282257849e7af84b73e1ac0f0d8b (diff)
* 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
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_eval.rb9
-rw-r--r--bootstraptest/test_knownbug.rb122
-rw-r--r--bootstraptest/test_literal.rb16
-rw-r--r--bootstraptest/test_syntax.rb50
-rw-r--r--bootstraptest/test_thread.rb22
5 files changed, 97 insertions, 122 deletions
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index 47976a3..339e763 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -227,3 +227,12 @@ assert_equal 'ok', %q{
:ng
end
}, "[ruby-dev:34236]"
+
+assert_equal 'ok', %q{
+ begin
+ eval("class nil::Foo; end")
+ :ng
+ rescue Exception
+ :ok
+ end
+}
diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb
index 9041cfd..afa258e 100644
--- a/bootstraptest/test_knownbug.rb
+++ b/bootstraptest/test_knownbug.rb
@@ -30,28 +30,6 @@ assert_equal 'ok', %q{
}, '[ruby-core:14813]'
assert_equal 'ok', %q{
- class X < RuntimeError;end
- x = [X]
- begin
- raise X
- rescue *x
- :ok
- end
-}, '[ruby-core:14537]'
-
-assert_normal_exit %q{
- "abc".gsub(/./, "a" => "z")
-}
-
-assert_normal_exit %q{
- Encoding.compatible?("",0)
-}
-
-assert_normal_exit %q{
- "".center(1, "\x80".force_encoding("utf-8"))
-}, '[ruby-dev:33807]'
-
-assert_equal 'ok', %q{
a = lambda {|x, y, &b| b }
b = a.curry[1]
if b.call(2){} == nil
@@ -62,10 +40,6 @@ assert_equal 'ok', %q{
}, '[ruby-core:15551]'
assert_normal_exit %q{
- sprintf("% 0e", 1.0/0.0)
-}
-
-assert_normal_exit %q{
g = Module.enum_for(:new)
loop { g.next }
}, '[ruby-dev:34128]'
@@ -111,102 +85,6 @@ assert_equal %q{[:bar, :foo]}, %q{
}, "[ ruby-Bugs-19304 ]"
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_equal 'ok', %q{
- def m
- t = Thread.new { while true do // =~ "" end }
- sleep 0.1
- 10.times {
- if /((ab)*(ab)*)*(b)/ =~ "ab"*7
- return :ng if !$4
- return :ng if $~.size != 5
- end
- }
- :ok
- ensure
- Thread.kill t
- end
- m
-}, '[ruby-dev:34492]'
-
-assert_normal_exit %q{
- begin
- r = 0**-1
- r + r
- rescue
- end
-}, '[ruby-dev:34524]'
-
-assert_normal_exit %q{
- begin
- r = Marshal.load("\x04\bU:\rRational[\ai\x06i\x05")
- r + r
- rescue
- end
-}, '[ruby-dev:34536]'
-
-assert_normal_exit %q{
- begin
- Struct.new(0)
- rescue
- end
-}
-
-assert_normal_exit %q{
- defined? C && 0
-}
-
-assert_normal_exit %q{
- class C
- def m
- defined?(super())
- end
- end
- C.new.m
-}
-
-assert_normal_exit %q{
- [1,2,3].slice!(1,10000).inspect
-}
-
-assert_equal 'ok', %q{
- begin
- eval("class nil::Foo; end")
- :ng
- rescue Exception
- :ok
- end
-}
-
-assert_normal_exit %q{
- at_exit { Fiber.new{}.resume }
-}
-
-assert_equal 'ok', %q{
lambda {
break :ok
:ng
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
index fe4e966..8480c65 100644
--- a/bootstraptest/test_literal.rb
+++ b/bootstraptest/test_literal.rb
@@ -176,3 +176,19 @@ assert_equal 'ok', %q{
ObjectSpace.each_object(Module) {|m| m.name.inspect }
:ok
}
+
+assert_normal_exit %q{
+ begin
+ r = 0**-1
+ r + r
+ rescue
+ end
+}, '[ruby-dev:34524]'
+
+assert_normal_exit %q{
+ begin
+ r = Marshal.load("\x04\bU:\rRational[\ai\x06i\x05")
+ r + r
+ rescue
+ end
+}, '[ruby-dev:34536]'
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index dc4cae3..5479de0 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]'
+
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 8d88a0f..3b1fa3f 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -246,3 +246,25 @@ assert_normal_exit %q{
t.join
}
}
+
+assert_equal 'ok', %q{
+ def m
+ t = Thread.new { while true do // =~ "" end }
+ sleep 0.1
+ 10.times {
+ if /((ab)*(ab)*)*(b)/ =~ "ab"*7
+ return :ng if !$4
+ return :ng if $~.size != 5
+ end
+ }
+ :ok
+ ensure
+ Thread.kill t
+ end
+ m
+}, '[ruby-dev:34492]'
+
+assert_normal_exit %q{
+ at_exit { Fiber.new{}.resume }
+}
+