/[pgestraier]/trunk/t/pgest.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/pgest.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 44 by dpavlin, Wed Jul 6 15:15:04 2005 UTC revision 45 by dpavlin, Sat Sep 10 23:08:47 2005 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 73;  use Test::More tests => 94;
6    
7  BEGIN {  BEGIN {
8          use_ok('DBI');          use_ok('DBI');
# Line 31  diag "$sql"; Line 31  diag "$sql";
31  my $sth = $dbh->prepare($sql) || die $dbh->errstr();  my $sth = $dbh->prepare($sql) || die $dbh->errstr();
32  ok($sth, "sth");  ok($sth, "sth");
33    
34    my $sql_node = "select id from pgest('http://localhost:1978/node/trivia','admin','admin',?,?,?,?,?,array['\@id']) as (id text)";
35    my $sth_node = $dbh->prepare($sql_node) || die $dbh->errstr();
36    ok($sth_node, "sth_node");
37    
38  sub pgest {  sub pgest {
39          $sth->execute(@_) || die $sth->errstr();          $sth->execute(@_) || die $sth->errstr();
40            $sth_node->execute(@_) || die $sth_node->errstr();
41          {          {
42                  no warnings;                  no warnings;
43                  ok($sth, "execute(".join(",",@_).")");                  ok($sth, "execute(".join(",",@_).")");
44                    ok($sth_node, "execute on node");
45          }          }
46    
47          my @arr;          my @arr;
48          while (my ($id) = $sth->fetchrow_array() ) {          while (my ($id) = $sth->fetchrow_array() ) {
49                  push @arr, $id;                  push @arr, $id;
50          }          }
51          ok(@arr, "pgest results: ".($#arr + 1));          my @arr_node;
52            while (my ($id) = $sth_node->fetchrow_array() ) {
53                    push @arr_node, $id;
54            }
55            cmp_ok($#arr, '==', $#arr_node, "pgest direct and node results");
56    
57          return @arr;          return @arr;
58  }  }

Legend:
Removed from v.44  
changed lines
  Added in v.45

  ViewVC Help
Powered by ViewVC 1.1.26