* 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
This commit is contained in:
parent
888c935930
commit
39fcd1cdf2
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Mon May 19 14:18:13 2008 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon May 19 13:23:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon May 19 13:23:03 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* process.c (rb_spawn_internal): set last_status when status == -1
|
* process.c (rb_spawn_internal): set last_status when status == -1
|
||||||
|
@ -227,3 +227,12 @@ assert_equal 'ok', %q{
|
|||||||
:ng
|
:ng
|
||||||
end
|
end
|
||||||
}, "[ruby-dev:34236]"
|
}, "[ruby-dev:34236]"
|
||||||
|
|
||||||
|
assert_equal 'ok', %q{
|
||||||
|
begin
|
||||||
|
eval("class nil::Foo; end")
|
||||||
|
:ng
|
||||||
|
rescue Exception
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
}
|
||||||
|
@ -29,28 +29,6 @@ assert_equal 'ok', %q{
|
|||||||
C.new.foo
|
C.new.foo
|
||||||
}, '[ruby-core:14813]'
|
}, '[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{
|
assert_equal 'ok', %q{
|
||||||
a = lambda {|x, y, &b| b }
|
a = lambda {|x, y, &b| b }
|
||||||
b = a.curry[1]
|
b = a.curry[1]
|
||||||
@ -61,10 +39,6 @@ assert_equal 'ok', %q{
|
|||||||
end
|
end
|
||||||
}, '[ruby-core:15551]'
|
}, '[ruby-core:15551]'
|
||||||
|
|
||||||
assert_normal_exit %q{
|
|
||||||
sprintf("% 0e", 1.0/0.0)
|
|
||||||
}
|
|
||||||
|
|
||||||
assert_normal_exit %q{
|
assert_normal_exit %q{
|
||||||
g = Module.enum_for(:new)
|
g = Module.enum_for(:new)
|
||||||
loop { g.next }
|
loop { g.next }
|
||||||
@ -110,102 +84,6 @@ assert_equal %q{[:bar, :foo]}, %q{
|
|||||||
foo
|
foo
|
||||||
}, "[ ruby-Bugs-19304 ]"
|
}, "[ 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{
|
assert_equal 'ok', %q{
|
||||||
lambda {
|
lambda {
|
||||||
break :ok
|
break :ok
|
||||||
|
@ -176,3 +176,19 @@ assert_equal 'ok', %q{
|
|||||||
ObjectSpace.each_object(Module) {|m| m.name.inspect }
|
ObjectSpace.each_object(Module) {|m| m.name.inspect }
|
||||||
:ok
|
: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]'
|
||||||
|
@ -767,3 +767,53 @@ assert_equal "1\n2\n", %q{
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]')
|
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]'
|
||||||
|
|
||||||
|
@ -246,3 +246,25 @@ assert_normal_exit %q{
|
|||||||
t.join
|
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 }
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1233,4 +1233,13 @@ class TestM17N < Test::Unit::TestCase
|
|||||||
s.setbyte(-4, 0x84)
|
s.setbyte(-4, 0x84)
|
||||||
assert_equal(u("\xE3\x81\x84\xE3\x81\x84"), s)
|
assert_equal(u("\xE3\x81\x84\xE3\x81\x84"), s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_compatible
|
||||||
|
assert_equal(nil, Encoding.compatible?("",0), "moved from btest/knownbug")
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_force_encoding
|
||||||
|
assert(("".center(1, "\x80".force_encoding("utf-8")); true),
|
||||||
|
"moved from btest/knownbug, [ruby-dev:33807]")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -210,6 +210,18 @@ class TestProc < Test::Unit::TestCase
|
|||||||
assert_equal(fib, [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89])
|
assert_equal(fib, [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_curry_from_knownbug
|
||||||
|
a = lambda {|x, y, &b| b }
|
||||||
|
b = a.curry[1]
|
||||||
|
|
||||||
|
assert_equal(:ok,
|
||||||
|
if b.call(2){} == nil
|
||||||
|
:ng
|
||||||
|
else
|
||||||
|
:ok
|
||||||
|
end, 'moved from btest/knownbug, [ruby-core:15551]')
|
||||||
|
end
|
||||||
|
|
||||||
def test_dup_clone
|
def test_dup_clone
|
||||||
b = proc {|x| x + "bar" }
|
b = proc {|x| x + "bar" }
|
||||||
class << b; attr_accessor :foo; end
|
class << b; attr_accessor :foo; end
|
||||||
|
@ -185,6 +185,7 @@ class TestSprintf < Test::Unit::TestCase
|
|||||||
def test_float
|
def test_float
|
||||||
assert_equal("36893488147419111424",
|
assert_equal("36893488147419111424",
|
||||||
sprintf("%20.0f", 36893488147419107329.0))
|
sprintf("%20.0f", 36893488147419107329.0))
|
||||||
|
assert_equal(" Inf", sprintf("% 0e", 1.0/0.0), "moved from btest/knownbug")
|
||||||
end
|
end
|
||||||
|
|
||||||
BSIZ = 120
|
BSIZ = 120
|
||||||
|
@ -624,6 +624,8 @@ class TestString < Test::Unit::TestCase
|
|||||||
a.taint
|
a.taint
|
||||||
assert(a.gsub(/./, S('X')).tainted?)
|
assert(a.gsub(/./, S('X')).tainted?)
|
||||||
|
|
||||||
|
assert_equal("z", "abc".gsub(/./, "a" => "z"), "moved from btest/knownbug")
|
||||||
|
|
||||||
assert_raise(ArgumentError) { "foo".gsub }
|
assert_raise(ArgumentError) { "foo".gsub }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1063,6 +1065,9 @@ class TestString < Test::Unit::TestCase
|
|||||||
assert_equal([S("a"), S(""), S("b"), S("c"), S("")], S("a||b|c|").split(S('|'), -1))
|
assert_equal([S("a"), S(""), S("b"), S("c"), S("")], S("a||b|c|").split(S('|'), -1))
|
||||||
|
|
||||||
assert_equal([], "".split(//, 1))
|
assert_equal([], "".split(//, 1))
|
||||||
|
|
||||||
|
assert_equal("[2, 3]", [1,2,3].slice!(1,10000).inspect, "moved from btest/knownbug")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_squeeze
|
def test_squeeze
|
||||||
|
@ -206,4 +206,10 @@ class TestStruct < Test::Unit::TestCase
|
|||||||
o = klass.new(1)
|
o = klass.new(1)
|
||||||
assert_equal(1, o.size)
|
assert_equal(1, o.size)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_error
|
||||||
|
assert_raise(TypeError){
|
||||||
|
Struct.new(0)
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user