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?
|
2008-01-25 13:02:01 -05:00
|
|
|
:ng
|
2008-05-19 12:47:42 -04: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]'
|
|
|
|
|
|
|
|
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-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
|
|
|
|
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]'
|
2008-04-06 23:28:23 -04:00
|
|
|
|
|
|
|
assert_equal %q{[:bar, :foo]}, %q{
|
|
|
|
def foo
|
|
|
|
klass = Class.new do
|
|
|
|
define_method(:bar) do
|
|
|
|
return :bar
|
|
|
|
end
|
|
|
|
end
|
|
|
|
[klass.new.bar, :foo]
|
|
|
|
end
|
|
|
|
foo
|
|
|
|
}, "[ ruby-Bugs-19304 ]"
|
|
|
|
|
2008-05-11 23:41:48 -04:00
|
|
|
assert_equal 'ok', %q{
|
|
|
|
lambda {
|
|
|
|
break :ok
|
|
|
|
:ng
|
|
|
|
}.call
|
|
|
|
}, '[ruby-dev:34646]'
|
2008-05-11 23:47:12 -04:00
|
|
|
|
2008-05-19 03:30:41 -04:00
|
|
|
assert_normal_exit %q{
|
|
|
|
eval("", method(:proc).call {}.binding)
|
|
|
|
}
|
2008-05-22 04:13:19 -04:00
|
|
|
|
|
|
|
assert_normal_exit %q{
|
|
|
|
a = []
|
|
|
|
100.times {|i| a << i << nil << nil }
|
|
|
|
p a.compact!
|
|
|
|
}
|
2008-05-23 21:57:02 -04:00
|
|
|
|
|
|
|
assert_equal 'ok', %q{
|
|
|
|
a = [false]
|
|
|
|
(a[0] &&= true) == false ? :ok : :ng
|
|
|
|
}, '[ruby-dev:34679]'
|