Skip to content
Browse files

more better tests.

  • Loading branch information...
1 parent 4bf9c20 commit 271184b01f22bee0bd2fed83f81f1d92856f49b0 @kuzuha committed Jan 2, 2012
Showing with 9 additions and 9 deletions.
  1. +6 −6 t/usual/hash/lsh.t
  2. +3 −3 t/usual/subtype/matrix.t
View
12 t/usual/hash/lsh.t
@@ -6,23 +6,23 @@ use Plann::Hash::LSH;
#
# random_matrix
#
-my $matrix = Plann::Hash::LSH->random_matrix(10, 5);
+my $matrix = Plann::Hash::LSH->random_matrix(20, 10);
isa_ok($matrix, 'Math::MatrixReal');
-is(10, $matrix->[1]);
-is(5, $matrix->[2]);
+is($matrix->[1], 20);
+is($matrix->[2], 10);
#
# constructors and accessors
#
my $lsh = Plann::Hash::LSH->new(matrix => $matrix);
-is($matrix, $lsh->matrix);
+is($lsh->matrix, $matrix);
#
# hash
#
-my $hash = $lsh->hash([1,2,3,4,5,6,7,8,9,10]);
+my $hash = $lsh->hash([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]);
isa_ok($hash, 'Math::MatrixReal');
ok($hash->is_row_vector());
-is(5, $matrix->[2]);
+is($matrix->[2], 10);
ok($hash->is_binary);
View
6 t/usual/subtype/matrix.t
@@ -18,11 +18,11 @@ $anon_class->add_attribute(
my $anon = $anon_class->new_object;
$anon->matrix([1,2,3]);
-is(Math::MatrixReal->new_from_rows([[1,2,3]]), $anon->matrix);
+is($anon->matrix, Math::MatrixReal->new_from_rows([[1,2,3]]));
$anon->matrix([[1,2], [3,4]]);
-is(Math::MatrixReal->new_from_rows([[1,2], [3,4]]), $anon->matrix);
+is($anon->matrix, Math::MatrixReal->new_from_rows([[1,2], [3,4]]));
my $matrix = Math::MatrixReal->new_from_rows([[1,1,1], [2,2,2]]);
$anon->matrix($matrix);
-is($matrix, $anon->matrix);
+is($anon->matrix, $matrix);

0 comments on commit 271184b

Please sign in to comment.
Something went wrong with that request. Please try again.