[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2399] trunk



Revision: 2399
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2399&view=rev
Author:   einhverfr
Date:     2008-11-14 19:37:36 +0000 (Fri, 14 Nov 2008)

Log Message:
-----------
Correcting compound array handling in DBObect.pm

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject.pm
    trunk/t/42-dbobject.t

Modified: trunk/LedgerSMB/DBObject.pm
===================================================================
--- trunk/LedgerSMB/DBObject.pm	2008-11-14 01:53:25 UTC (rev 2398)
+++ trunk/LedgerSMB/DBObject.pm	2008-11-14 19:37:36 UTC (rev 2399)
@@ -272,7 +272,7 @@
             $close_braces =~ s/{/}/g;
             $value =~ /^{($open_braces[^}]*$close_braces)/;
             my $parse_next = $1;
-            $value =~ s/^{$parse_next/{/;
+            $value =~ s/^{$parse_next,?/{/;
             @$next = $self->_parse_array($parse_next);
             
         } else {

Modified: trunk/t/42-dbobject.t
===================================================================
--- trunk/t/42-dbobject.t	2008-11-14 01:53:25 UTC (rev 2398)
+++ trunk/t/42-dbobject.t	2008-11-14 19:37:36 UTC (rev 2399)
@@ -1,5 +1,5 @@
 use LedgerSMB::DBObject;
-use Test::More tests => 4;
+use Test::More tests => 5;
 
 # Array parsing tests
 my $test = '{test,"test2\"\",",test3,"test4"}';
@@ -9,4 +9,7 @@
   is($_, shift @vals, "pass $pass, array parse test");
 }
 
+my $test2 = '{{1,1,1,1},{1,2,2,2}}';
 
+my @test_arry2 = LedgerSMB::DBObject->_parse_array($test2);
+is(scalar @test_arry2, 2, 'Compount array with proper element count');


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.