mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby: fixed nonsense assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4c205de3e6
commit
e1cc514073
8 changed files with 12 additions and 10 deletions
|
@ -1,4 +1,6 @@
|
|||
Thu Apr 29 14:24:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Thu Apr 29 14:33:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* test/ruby: fixed nonsense assertions.
|
||||
|
||||
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
|
||||
reverted. [ruby-core:29872]
|
||||
|
|
|
@ -287,7 +287,7 @@ module MarshalTestLib
|
|||
o.extend(Mod1)
|
||||
str = MyString.new(o, "c")
|
||||
marshal_equal(str) { |v|
|
||||
assert(v.instance_eval { @v }).kind_of?(Mod1)
|
||||
assert(v.instance_eval { @v }.kind_of?(Mod1))
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -1837,8 +1837,8 @@ class TestArray < Test::Unit::TestCase
|
|||
o = Object.new
|
||||
def o.to_ary; end
|
||||
def o.==(x); :foo; end
|
||||
assert(:foo, [0, 1, 2] == o)
|
||||
assert([0, 1, 2] != [0, 1, 3])
|
||||
assert_equal([0, 1, 2], o)
|
||||
assert_not_equal([0, 1, 2], [0, 1, 3])
|
||||
end
|
||||
|
||||
def test_hash2
|
||||
|
|
|
@ -434,7 +434,7 @@ class TestFileExhaustive < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_extname
|
||||
assert(".test", File.extname(@file))
|
||||
assert_equal(".test", File.extname(@file))
|
||||
prefixes = ["", "/", ".", "/.", "bar/.", "/bar/."]
|
||||
infixes = ["", " ", "."]
|
||||
infixes2 = infixes + [".ext "]
|
||||
|
|
|
@ -245,8 +245,8 @@ class TestFloat < Test::Unit::TestCase
|
|||
|
||||
def test_infinite_p
|
||||
inf = Float::INFINITY
|
||||
assert(1, inf.infinite?)
|
||||
assert(1, (-inf).infinite?)
|
||||
assert_equal(1, inf.infinite?)
|
||||
assert_equal(-1, (-inf).infinite?)
|
||||
assert_nil(1.0.infinite?)
|
||||
end
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ class TestIterator < Test::Unit::TestCase
|
|||
rescue LocalJumpError
|
||||
assert(false, "LocalJumpError occurred from break in lambda")
|
||||
else
|
||||
assert(11, val)
|
||||
assert_equal(11, val)
|
||||
end
|
||||
|
||||
block = get_block{11}
|
||||
|
|
|
@ -241,7 +241,7 @@ class TestModule < Test::Unit::TestCase
|
|||
"foo"
|
||||
end
|
||||
end
|
||||
assert("foo", Other.class_eval_test)
|
||||
assert_equal("foo", Other.class_eval_test)
|
||||
|
||||
assert_equal([Other], Other.class_eval { |*args| args })
|
||||
end
|
||||
|
|
|
@ -379,7 +379,7 @@ class TestProc < Test::Unit::TestCase
|
|||
assert_equal [1,2,3,[4,5,6]], pr.call([1,2,3,4,5,6])
|
||||
|
||||
r = proc{|*a| a}.call([1,2,3])
|
||||
assert [1,2,3], r
|
||||
assert_equal [[1,2,3]], r
|
||||
end
|
||||
|
||||
def test_proc_args_rest_and_post
|
||||
|
|
Loading…
Reference in a new issue