2007-08-28 23:48:19 -04:00
|
|
|
#
|
|
|
|
# This test file concludes tests which point out known bugs.
|
|
|
|
# So all tests will cause failure.
|
|
|
|
#
|
2007-12-28 23:27:39 -05:00
|
|
|
|
2008-01-07 02:07:44 -05:00
|
|
|
assert_equal 'ok', %q{
|
|
|
|
class C
|
|
|
|
define_method(:foo) {
|
|
|
|
if block_given?
|
|
|
|
:ok
|
2008-01-25 13:02:01 -05:00
|
|
|
else
|
|
|
|
:ng
|
2008-01-07 02:07:44 -05:00
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
2008-01-25 13:02:01 -05:00
|
|
|
C.new.foo {}
|
2008-01-07 02:07:44 -05:00
|
|
|
}, '[ruby-core:14813]'
|
|
|
|
|
|
|
|
assert_equal 'ok', %q{
|
|
|
|
class C
|
|
|
|
define_method(:foo) {
|
|
|
|
if block_given?
|
|
|
|
:ng
|
2008-01-25 13:02:01 -05:00
|
|
|
else
|
|
|
|
:ok
|
2008-01-07 02:07:44 -05:00
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
2008-01-25 13:02:01 -05:00
|
|
|
C.new.foo
|
2008-01-07 02:07:44 -05:00
|
|
|
}, '[ruby-core:14813]'
|
2008-01-07 05:01:34 -05:00
|
|
|
|
2008-01-25 13:02:01 -05:00
|
|
|
assert_equal 'ok', %q{
|
|
|
|
class X < RuntimeError;end
|
|
|
|
x = [X]
|
2008-01-22 21:23:21 -05:00
|
|
|
begin
|
2008-01-25 13:02:01 -05:00
|
|
|
raise X
|
|
|
|
rescue *x
|
|
|
|
:ok
|
2008-01-22 21:23:21 -05:00
|
|
|
end
|
2008-01-25 13:02:01 -05:00
|
|
|
}, '[ruby-core:14537]'
|
2008-01-12 11:42:43 -05:00
|
|
|
|
2008-02-15 13:16:14 -05:00
|
|
|
assert_normal_exit %q{
|
|
|
|
"abc".gsub(/./, "a" => "z")
|
|
|
|
}
|
2008-02-18 03:16:10 -05:00
|
|
|
|
2008-02-15 23:21:46 -05:00
|
|
|
assert_normal_exit %q{
|
|
|
|
Encoding.compatible?("",0)
|
|
|
|
}
|
2008-02-18 03:16:10 -05:00
|
|
|
|
2008-02-16 00:48:42 -05:00
|
|
|
assert_normal_exit %q{
|
|
|
|
"".center(1, "\x80".force_encoding("utf-8"))
|
|
|
|
}, '[ruby-dev:33807]'
|
2008-02-29 22:42:58 -05:00
|
|
|
|
|
|
|
assert_equal 'ok', %q{
|
|
|
|
a = lambda {|x, y, &b| b }
|
|
|
|
b = a.curry[1]
|
|
|
|
if b.call(2){} == nil
|
|
|
|
:ng
|
|
|
|
else
|
|
|
|
:ok
|
|
|
|
end
|
|
|
|
}, '[ruby-core:15551]'
|
2008-03-05 08:31:06 -05:00
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
sprintf("% 0e", 1.0/0.0)
|
|
|
|
}
|
2008-03-25 06:35:20 -04:00
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
g = Module.enum_for(:new)
|
|
|
|
loop { g.next }
|
|
|
|
}, '[ruby-dev:34128]'
|
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
Fiber.new(&Object.method(:class_eval)).resume("foo")
|
|
|
|
}, '[ruby-dev:34128]'
|
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
Thread.new("foo", &Object.method(:class_eval)).join
|
|
|
|
}, '[ruby-dev:34128]'
|
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
g = enum_for(:local_variables)
|
|
|
|
loop { g.next }
|
|
|
|
}, '[ruby-dev:34128]'
|
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
g = enum_for(:block_given?)
|
|
|
|
loop { g.next }
|
|
|
|
}, '[ruby-dev:34128]'
|
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
g = enum_for(:binding)
|
|
|
|
loop { g.next }
|
|
|
|
}, '[ruby-dev:34128]'
|
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
g = "abc".enum_for(:scan, /./)
|
|
|
|
loop { g.next }
|
|
|
|
}, '[ruby-dev:34128]'
|