[前][次][番号順一覧][スレッド一覧]

ruby-changes:7831

From: yugui <ko1@a...>
Date: Mon, 15 Sep 2008 10:34:00 +0900 (JST)
Subject: [ruby-changes:7831] Ruby:r19352 (trunk): * test/matrix/test_matrix.rb (setup): typo.

yugui	2008-09-15 10:33:43 +0900 (Mon, 15 Sep 2008)

  New Revision: 19352

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19352

  Log:
    * test/matrix/test_matrix.rb (setup): typo.
      (test_equality): misdefinition of the expected working.
      Reported by an anonymous user.
      (test_hash): added.
    
    * test/matrix/test_vector.rb: ditto.
    Mon Sep 15 03:33:10 2008  Tanaka Akira  <akr@f...>

  Modified files:
    trunk/ChangeLog
    trunk/test/matrix/test_matrix.rb
    trunk/test/matrix/test_vector.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19351)
+++ ChangeLog	(revision 19352)
@@ -1,3 +1,12 @@
+Mon Sep 15 10:28:10 2008  Yuki Sonoda (Yugui)  <yugui@y...>
+
+	* test/matrix/test_matrix.rb (setup): typo.
+	  (test_equality): misdefinition of the expected working.
+	  Reported by an anonymous user.
+	  (test_hash): added.
+
+	* test/matrix/test_vector.rb: ditto.
+
 Mon Sep 15 03:33:10 2008  Tanaka Akira  <akr@f...>
 
 	* transcode_data.h: return output functions ssize_t.
Index: test/matrix/test_vector.rb
===================================================================
--- test/matrix/test_vector.rb	(revision 19351)
+++ test/matrix/test_vector.rb	(revision 19352)
@@ -6,7 +6,7 @@
     @v1 = Vector[1,2,3]
     @v2 = Vector[1,2,3]
     @v3 = @v1.clone
-    @v4 = Vector[1,0, 2.0, 3.0]
+    @v4 = Vector[1.0, 2.0, 3.0]
     @w1 = Vector[2,3,4]
   end
 
@@ -22,7 +22,7 @@
     assert_equal @v1, @v1
     assert_equal @v1, @v2
     assert_equal @v1, @v3
-    assert_not_equal @v1, @v4
+    assert_equal @v1, @v4
     assert_not_equal @v1, @w1
   end
 
@@ -40,4 +40,10 @@
     assert !hash.key?(@v4)
     assert !hash.key?(@w1)
   end
+
+  def test_hash
+    assert_equal @v1.hash, @v1.hash
+    assert_equal @v1.hash, @v2.hash
+    assert_equal @v1.hash, @v3.hash
+  end
 end
Index: test/matrix/test_matrix.rb
===================================================================
--- test/matrix/test_matrix.rb	(revision 19351)
+++ test/matrix/test_matrix.rb	(revision 19352)
@@ -6,7 +6,7 @@
     @m1 = Matrix[[1,2,3], [4,5,6]]
     @m2 = Matrix[[1,2,3], [4,5,6]]
     @m3 = @m1.clone
-    @m4 = Matrix[[1,0, 2.0, 3.0], [4.0, 5.0, 6.0]]
+    @m4 = Matrix[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]
     @n1 = Matrix[[2,3,4], [5,6,7]]
   end
 
@@ -22,7 +22,7 @@
     assert_equal @m1, @m1
     assert_equal @m1, @m2
     assert_equal @m1, @m3
-    assert_not_equal @m1, @m4
+    assert_equal @m1, @m4
     assert_not_equal @m1, @n1
   end
 
@@ -40,4 +40,10 @@
     assert !hash.key?(@m4)
     assert !hash.key?(@n1)
   end
+
+  def test_hash
+    assert_equal @m1.hash, @m1.hash
+    assert_equal @m1.hash, @m2.hash
+    assert_equal @m1.hash, @m3.hash
+  end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]