mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-05-16 09:59:39 +08:00
update tests (comment/uncomment out)
This commit is contained in:
@@ -115,23 +115,23 @@ assert_equal 'Class', proc{ class C; end; C.dup.class }
|
||||
assert_equal 'Module', proc{ module M; end; M.dup.class }
|
||||
|
||||
|
||||
# assert_equal "ok", proc{
|
||||
# module Foo
|
||||
# end
|
||||
assert_equal "ok", proc{
|
||||
module Foo
|
||||
end
|
||||
|
||||
# begin
|
||||
# def foo(&b)
|
||||
# Foo.module_eval &b
|
||||
# end
|
||||
# foo{
|
||||
# def bar
|
||||
# end
|
||||
# }
|
||||
# bar()
|
||||
# rescue NameError
|
||||
# :ok
|
||||
# end
|
||||
# }, '[ruby-core:14378]'
|
||||
begin
|
||||
def foo(&b)
|
||||
Foo.module_eval &b
|
||||
end
|
||||
foo{
|
||||
def bar
|
||||
end
|
||||
}
|
||||
bar()
|
||||
rescue NameError
|
||||
:ok
|
||||
end
|
||||
}, '[ruby-core:14378]'
|
||||
|
||||
# assert_equal '3', proc{
|
||||
# $i = 0
|
||||
|
||||
3
test/TestUnit/ruby
Executable file
3
test/TestUnit/ruby
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
/Library/RubyMotion/bin/ruby -r require_relative.rb -Ilib $@ --seed 0
|
||||
@@ -854,7 +854,7 @@ class TestArray < Test::Unit::TestCase
|
||||
a2 = @cls[ 'cat', 'dog' ]
|
||||
a3 = @cls[ 'dog', 'cat' ]
|
||||
assert(a1.hash == a2.hash)
|
||||
# assert(a1.hash != a3.hash)
|
||||
assert(a1.hash != a3.hash)
|
||||
end
|
||||
|
||||
def test_include?
|
||||
@@ -1875,7 +1875,7 @@ class TestArray < Test::Unit::TestCase
|
||||
a = []
|
||||
a << a
|
||||
assert_equal([[a]].hash, a.hash)
|
||||
assert_not_equal([a, a].hash, a.hash) # Implementation dependent
|
||||
# assert_not_equal([a, a].hash, a.hash) # Implementation dependent
|
||||
end
|
||||
|
||||
def test_flatten_error
|
||||
|
||||
@@ -10,8 +10,8 @@ class TestInteger < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_aref
|
||||
# assert_equal(1, (1 << 0x40000000)[0x40000000], "[ruby-dev:31271]")
|
||||
# assert_equal(0, (-1 << 0x40000001)[0x40000000], "[ruby-dev:31271]")
|
||||
assert_equal(1, (1 << 0x40000000)[0x40000000], "[ruby-dev:31271]")
|
||||
assert_equal(0, (-1 << 0x40000001)[0x40000000], "[ruby-dev:31271]")
|
||||
big_zero = 0x40000000.coerce(0)[0]
|
||||
assert_equal(0, (-0x40000002)[big_zero], "[ruby-dev:31271]")
|
||||
assert_equal(1, 0x400000001[big_zero], "[ruby-dev:31271]")
|
||||
@@ -30,16 +30,16 @@ class TestInteger < Test::Unit::TestCase
|
||||
assert_equal(0, 1 << -0x40000001)
|
||||
assert_equal(0, 1 << -0x80000000)
|
||||
assert_equal(0, 1 << -0x80000001)
|
||||
# assert_equal(bdsize(0x80000000), (1 << 0x80000000).size)
|
||||
assert_equal(bdsize(0x80000000), (1 << 0x80000000).size)
|
||||
end
|
||||
|
||||
def test_rshift
|
||||
# assert_equal(bdsize(0x40000001), (1 >> -0x40000001).size)
|
||||
assert_equal(bdsize(0x40000001), (1 >> -0x40000001).size)
|
||||
assert((1 >> 0x80000000).zero?)
|
||||
assert((1 >> 0xffffffff).zero?)
|
||||
assert((1 >> 0x100000000).zero?)
|
||||
# assert_equal((1 << 0x40000000), (1 >> -0x40000000))
|
||||
# assert_equal((1 << 0x40000001), (1 >> -0x40000001))
|
||||
assert_equal((1 << 0x40000000), (1 >> -0x40000000))
|
||||
assert_equal((1 << 0x40000001), (1 >> -0x40000001))
|
||||
end
|
||||
|
||||
def test_Integer
|
||||
|
||||
@@ -17,7 +17,7 @@ class TestMath < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_atan2
|
||||
assert_raise(Math::DomainError) { Math.atan2(0, 0) }
|
||||
# assert_raise(Math::DomainError) { Math.atan2(0, 0) }
|
||||
assert_raise(Math::DomainError) { Math.atan2(Float::INFINITY, Float::INFINITY) }
|
||||
assert_raise(Math::DomainError) { Math.atan2(Float::INFINITY, -Float::INFINITY) }
|
||||
assert_raise(Math::DomainError) { Math.atan2(-Float::INFINITY, Float::INFINITY) }
|
||||
|
||||
@@ -882,7 +882,7 @@ class TestNSArray < Test::Unit::TestCase
|
||||
a2 = @cls[ 'cat', 'dog' ]
|
||||
a3 = @cls[ 'dog', 'cat' ]
|
||||
assert(a1.hash == a2.hash)
|
||||
# assert(a1.hash != a3.hash)
|
||||
assert(a1.hash != a3.hash)
|
||||
end
|
||||
|
||||
def test_include?
|
||||
@@ -1905,7 +1905,7 @@ class TestNSArray < Test::Unit::TestCase
|
||||
a = @cls[]
|
||||
a << a
|
||||
assert_equal([[a]].hash, a.hash)
|
||||
assert_not_equal([a, a].hash, a.hash) # Implementation dependent
|
||||
# assert_not_equal([a, a].hash, a.hash) # Implementation dependent
|
||||
end
|
||||
|
||||
def test_flatten_error
|
||||
|
||||
Reference in New Issue
Block a user