summaryrefslogtreecommitdiff
path: root/t/42-dbobject.t
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-11-15 23:57:07 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-11-15 23:57:07 +0000
commitff686b3e857fc34aabf2bb4d444b851df803352c (patch)
tree37f16b8e9d7e444c6e2c7d4b1c530252a95763b6 /t/42-dbobject.t
parent4548566ebb520679c2b7d9c5e2d786d3b0ea3c98 (diff)
Test case additions, and a few corrections
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2401 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 't/42-dbobject.t')
-rw-r--r--t/42-dbobject.t17
1 files changed, 13 insertions, 4 deletions
diff --git a/t/42-dbobject.t b/t/42-dbobject.t
index 65cbbb1c..ccb94bc9 100644
--- a/t/42-dbobject.t
+++ b/t/42-dbobject.t
@@ -1,5 +1,5 @@
use LedgerSMB::DBObject;
-use Test::More tests => 5;
+use Test::More tests => 20;
# Array parsing tests
my $test = '{test,"test2\"\",",test3,"test4"}';
@@ -9,7 +9,16 @@ for (LedgerSMB::DBObject->_parse_array($test)){
is($_, shift @vals, "pass $pass, array parse test");
}
-my $test2 = '{{1,1,1,1},{1,2,2,2}}';
-
+my $test2 = '{{1,1,1,1},{1,2,2,2},{1,3,3,4}}';
+my @test_arry2_c = ( [1,1,1,1], [1,2,2,2], [1,3,3,4]);
my @test_arry2 = LedgerSMB::DBObject->_parse_array($test2);
-is(scalar @test_arry2, 2, 'Compount array with proper element count');
+is(scalar @test_arry2, 3, 'Compount array with proper element count');
+is(scalar @{$test_arry2[0]}, 4, 'Subarray 1 has correct element count');
+is(scalar @{$test_arry2[1]}, 4, 'Subarray 2 has correct element count');
+is(scalar @{$test_arry2[2]}, 4, 'Subarray 3 has correct element count');
+for my $outer(0 .. 2){
+ for my $inner(0 .. 3) {
+ is ($test_arry2[$outer]->[$inner], $test_arry2_c[$outer]->[$inner],
+ "Compound array $outer/$inner correct");
+ }
+}