r624@llin: dpavlin | 2006-05-14 11:16:16 +0200
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 May 2006 09:33:56 +0000 (09:33 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 May 2006 09:33:56 +0000 (09:33 +0000)
 don't stop on empty records

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@482 07558da8-63fa-0310-ba24-9fe276d99e06

t/6-unit.t

index d8be2a6..1f26ccd 100755 (executable)
@@ -41,7 +41,7 @@ ok(my $lookup = new WebPAC::Lookup(
 ok(my $isis = new WebPAC::Input(
        module => 'WebPAC::Input::ISIS',
        code_page => 'ISO-8859-2',      # application encoding
-       limit => 10,
+#      limit => 10,
 ), "new Input::ISIS");
 
 ok(my $maxmfn = $isis->open(
@@ -78,14 +78,16 @@ ok(my $out = new WebPAC::Output::TT(
 
 diag " lookup => ",Dumper($lookup->lookup_hash) if ($debug);
 
-while (my $row = $isis->fetch) {
+foreach my $pos ( 0 ... $isis->size ) {
 
-       diag " row => ",Dumper($row) if ($debug);
+       my $row = $isis->fetch || next;
+
+       diag " row $pos => ",Dumper($row) if ($debug);
        set_rec( $row );
 
        ok(my $ds = $n->data_structure($row), "data_structure");
 
-       diag " ds => ",Dumper($ds) if ($debug);
+       diag " ds $pos => ",Dumper($ds) if ($debug);
 
        # TODO move somewhere
        {
@@ -98,7 +100,7 @@ while (my $row = $isis->fetch) {
                ok(my $ds2 = get_ds(), "get_ds");
                is_deeply( $ds, $ds2, 'ds same for xml and sets');
 
-               diag " ds2 => ",Dumper($ds2) if ($debug);
+               diag " ds2 $pos => ",Dumper($ds2) if ($debug);
        }
 
        ok(my $html = $out->apply(