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-09-26 18:40:44 -04:00
|
|
|
|
2007-12-01 12:29:43 -05:00
|
|
|
assert_equal '0', %q{
|
|
|
|
GC.stress = true
|
|
|
|
pid = fork {}
|
|
|
|
Process.wait pid
|
|
|
|
$?.to_i
|
|
|
|
}, '[ruby-dev:32404]'
|
2007-12-01 20:43:29 -05:00
|
|
|
|
2007-12-04 01:31:42 -05:00
|
|
|
assert_normal_exit %q{
|
2007-12-06 05:09:44 -05:00
|
|
|
"abcdefghij\xf0".force_encoding("utf-8").reverse.inspect
|
2007-12-04 01:31:42 -05:00
|
|
|
}, '[ruby-dev:32448]'
|
2007-12-05 19:27:35 -05:00
|
|
|
|
2007-12-05 21:04:19 -05:00
|
|
|
assert_equal 'ok', %q{
|
2007-12-05 19:27:35 -05:00
|
|
|
class C
|
2007-12-05 21:04:19 -05:00
|
|
|
define_method(:foo) do |arg, &block|
|
2007-12-05 19:27:35 -05:00
|
|
|
if block then block.call else arg end
|
2007-12-05 21:04:19 -05:00
|
|
|
end
|
2007-12-05 19:27:35 -05:00
|
|
|
end
|
|
|
|
C.new.foo("ng") {"ok"}
|
|
|
|
}, '[ruby-talk:266422]'
|
2007-12-05 21:04:19 -05:00
|
|
|
|
|
|
|
assert_equal 'ok', %q{
|
|
|
|
STDERR.reopen(STDOUT)
|
|
|
|
class C
|
|
|
|
define_method(:foo) do |&block|
|
|
|
|
block.call if block
|
|
|
|
end
|
|
|
|
result = "ng"
|
|
|
|
new.foo() {result = "ok"}
|
|
|
|
result
|
|
|
|
end
|
|
|
|
}
|
2007-12-06 20:42:16 -05:00
|
|
|
|
|
|
|
assert_equal 'ok', %q{
|
|
|
|
begin
|
|
|
|
if ("\xa1\xa2\xa1\xa3").force_encoding("euc-jp").split(//) ==
|
|
|
|
["\xa1\xa2".force_encoding("euc-jp"), "\xa1\xa3".force_encoding("euc-jp")]
|
|
|
|
:ok
|
|
|
|
else
|
|
|
|
:ng
|
|
|
|
end
|
|
|
|
rescue
|
|
|
|
:ng
|
|
|
|
end
|
|
|
|
}, '[ruby-dev:32452]'
|
2007-12-08 12:41:47 -05:00
|
|
|
|
|
|
|
assert_equal 'ok', %q{
|
|
|
|
begin
|
|
|
|
"\xa1\xa1".force_encoding("euc-jp") + "\xa1".force_encoding("ascii-8bit")
|
|
|
|
:ng
|
|
|
|
rescue ArgumentError
|
|
|
|
:ok
|
|
|
|
end
|
|
|
|
}
|