perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r391122 - in /perl/modperl/trunk/t: modperl/pnotes.t response/TestModperl/pnotes.pm
Date Mon, 03 Apr 2006 19:21:43 GMT
Author: geoff
Date: Mon Apr  3 12:21:41 2006
New Revision: 391122

URL: http://svn.apache.org/viewcvs?rev=391122&view=rev
Log:
make sure that blessed objects don't use their
properties during pnotes freeze/thaw

Modified:
    perl/modperl/trunk/t/modperl/pnotes.t
    perl/modperl/trunk/t/response/TestModperl/pnotes.pm

Modified: perl/modperl/trunk/t/modperl/pnotes.t
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/modperl/pnotes.t?rev=391122&r1=391121&r2=391122&view=diff
==============================================================================
--- perl/modperl/trunk/t/modperl/pnotes.t (original)
+++ perl/modperl/trunk/t/modperl/pnotes.t Mon Apr  3 12:21:41 2006
@@ -10,7 +10,7 @@
 
 t_debug("connecting to $url");
 
-plan tests => (22 * 3);
+plan tests => (26 * 3);
 
 # first with keepalives
 Apache::TestRequest::user_agent(reset => 1, keep_alive => 1);

Modified: perl/modperl/trunk/t/response/TestModperl/pnotes.pm
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/response/TestModperl/pnotes.pm?rev=391122&r1=391121&r2=391122&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestModperl/pnotes.pm (original)
+++ perl/modperl/trunk/t/response/TestModperl/pnotes.pm Mon Apr  3 12:21:41 2006
@@ -19,8 +19,8 @@
     Apache::Test::init_test_pm($r);
     
     Test::_reset_globals() if Test->can('_reset_globals');
-    $Test::ntest   = 1 + (22 * ($r->args - 1));
-    $Test::planned = 22;
+    $Test::ntest   = 1 + (26 * ($r->args - 1));
+    $Test::planned = 26;
 
     my $c = $r->connection;
 
@@ -82,6 +82,28 @@
         ok t_cmp($o->pnotes('pnotes_foo'), undef,
                  "deleted $type contents");
         ok !exists $o->pnotes->{'pnotes_foo'};
+
+        # test blessed references, like DBI
+        # DBD::DBM ships with DBI...
+        if (have_module(qw(DBI DBD::DBM))) {
+          my $dbh = DBI->connect('dbi:DBM:');
+
+          $o->pnotes(DBH => $dbh);
+
+          my $pdbh = $o->pnotes('DBH');
+
+          ok t_cmp(ref($pdbh), 'DBI::db', "ref($type->pnotes('DBH'))");
+
+          my $quote = $pdbh->quote("quoth'me");
+
+          # see the DBI manpage for why quote() returns the string
+          # wrapped in ' marks
+          ok t_cmp($quote, "'quoth\\'me'", '$pdbh->quote() works');
+        }
+        else {
+          skip ('skipping $dbh retrival test - no DBI or DBD::DBM');
+          skip ('skipping $dbh->quote() test - no DBI or DBD::DBM');
+        } 
     }
 
     # set pnotes so we can test unset on later connections



Mime
View raw message