summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--test/ruby/test_bignum.rb18
-rw-r--r--test/ruby/test_hash.rb4
-rw-r--r--test/ruby/test_iterator.rb4
-rw-r--r--test/ruby/test_pack.rb2
-rw-r--r--test/ruby/test_stringchar.rb2
-rw-r--r--test/ruby/test_system.rb1
-rw-r--r--test/ruby/test_trace.rb8
-rw-r--r--test/ruby/test_variable.rb9
-rw-r--r--test/ruby/test_whileuntil.rb4
10 files changed, 28 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index 540ff70c2..b7965b4ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Sep 6 02:26:34 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * test/ruby/test_*.rb: assert_same, assert_match, and so on.
+
Sat Sep 6 18:45:46 2003 Mauricio Fernandez <batsman.geo@yahoo.com>
* parse.y (assignable): call rb_compile_error(), not rb_bug().
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
index 0ba2397c5..d05bc5406 100644
--- a/test/ruby/test_bignum.rb
+++ b/test/ruby/test_bignum.rb
@@ -72,17 +72,17 @@ class TestBignum < Test::Unit::TestCase
assert_equal(0, -a % b)
end
- def test_shift
- def shift_test(a)
- b = a / (2 ** 32)
- c = a >> 32
- assert_equal(b, c)
+ def shift_test(a)
+ b = a / (2 ** 32)
+ c = a >> 32
+ assert_equal(b, c)
- b = a * (2 ** 32)
- c = a << 32
- assert_equal(b, c)
- end
+ b = a * (2 ** 32)
+ c = a << 32
+ assert_equal(b, c)
+ end
+ def test_shift
shift_test(-4518325415524767873)
shift_test(-0xfffffffffffffffff)
end
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index 22c694ef1..e21c464de 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -45,11 +45,11 @@ class TestHash < Test::Unit::TestCase
$x = Hash.new([])
assert_equal([], $x[22])
- assert($x[22].equal?($x[22]))
+ assert_same($x[22], $x[22])
$x = Hash.new{[]}
assert_equal([], $x[22])
- assert(!$x[22].equal?($x[22]))
+ assert_not_same($x[22], $x[22])
$x = Hash.new{|h,k| $z = k; h[k] = k*2}
$z = 0
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb
index 296efaf26..4947ed26c 100644
--- a/test/ruby/test_iterator.rb
+++ b/test/ruby/test_iterator.rb
@@ -252,7 +252,7 @@ class TestIterator < Test::Unit::TestCase
assert_nothing_raised {Proc.new{|a,|}.call(1,2)}
end
- def return1_test # !! test_return1 -> return1_test
+ def return1_test
Proc.new {
return 55
}.call + 5
@@ -262,7 +262,7 @@ class TestIterator < Test::Unit::TestCase
assert_equal(55, return1_test())
end
- def return2_test # !! test_return2 -> return2_test
+ def return2_test
lambda {
return 55
}.call + 5
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb
index 4132c89a6..c7097af42 100644
--- a/test/ruby/test_pack.rb
+++ b/test/ruby/test_pack.rb
@@ -13,7 +13,7 @@ class TestPack < Test::Unit::TestCase
assert_equal(ary.length, ary2.length)
assert_equal(ary.join(':'), ary2.join(':'))
- assert($x =~ /def/)
+ assert_match(/def/, $x)
$x = [-1073741825]
assert_equal($x, $x.pack("q").unpack("q"))
diff --git a/test/ruby/test_stringchar.rb b/test/ruby/test_stringchar.rb
index 9e22bb35a..e9b643ad3 100644
--- a/test/ruby/test_stringchar.rb
+++ b/test/ruby/test_stringchar.rb
@@ -5,7 +5,7 @@ $KCODE = 'none'
class TestStringchar < Test::Unit::TestCase
def test_string
assert_equal("abcd", "abcd")
- assert("abcd" =~ /abcd/)
+ assert_match(/abcd/, "abcd")
assert("abcd" === "abcd")
# compile time string concatenation
assert_equal("abcd", "ab" "cd")
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 6865515d4..a3da43459 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -57,7 +57,6 @@ class TestSystem < Test::Unit::TestCase
File.unlink "script_tmp" or `/bin/rm -f "script_tmp"`
File.unlink "script_tmp.bak" or `/bin/rm -f "script_tmp.bak"`
- $bad = false
if (dir = File.dirname(File.dirname($0))) == '.'
dir = ""
else
diff --git a/test/ruby/test_trace.rb b/test/ruby/test_trace.rb
index 4a2e7c4f8..69c0c24fe 100644
--- a/test/ruby/test_trace.rb
+++ b/test/ruby/test_trace.rb
@@ -9,15 +9,15 @@ class TestTrace < Test::Unit::TestCase
trace_var :$x, proc{$y = $x}
$x = 40414
assert_equal($x, $y)
-
+
untrace_var :$x
$x = 19660208
- assert($y != $x)
-
+ assert_not_equal($x, $y)
+
trace_var :$x, proc{$x *= 2}
$x = 5
assert_equal(10, $x)
-
+
untrace_var :$x
end
end
diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb
index 305a6f22c..ab0e40511 100644
--- a/test/ruby/test_variable.rb
+++ b/test/ruby/test_variable.rb
@@ -32,14 +32,11 @@ class TestVariable < Test::Unit::TestCase
end
def test_variable
- assert($$.instance_of?(Fixnum))
-
+ assert_instance_of(Fixnum, $$)
+
# read-only variable
- begin
+ assert_raises(NameError) do
$$ = 5
- assert false
- rescue NameError
- assert true
end
foobar = "foobar"
diff --git a/test/ruby/test_whileuntil.rb b/test/ruby/test_whileuntil.rb
index 0dba4c9ee..841a15135 100644
--- a/test/ruby/test_whileuntil.rb
+++ b/test/ruby/test_whileuntil.rb
@@ -13,8 +13,8 @@ class TestWhileuntil < Test::Unit::TestCase
tmp.close
tmp = open("while_tmp", "r")
- assert_kind_of(File, tmp)
-
+ assert_instance_of(File, tmp)
+
while line = tmp.gets()
break if /vt100/ =~ line
end