Forwarding to dbi-dev to make sure the patch doesn't get lost (it's
likely that the developers read dbi-users, but not certain).

This patch fixes a test failure with 15array.t on some platforms:

diff -Naur DBI-1.37/t/15array.t DBI-1.37-new/t/15array.t
--- DBI-1.37/t/15array.t        2003-05-11 13:45:27.000000000 +0100
+++ DBI-1.37-new/t/15array.t    2003-08-07 10:39:20.112963000 +0100
@@ -75,8 +75,11 @@
 my $fetchrow = sub { # generate 5 rows of two integer values
     return if $index >= 2;
     $index +=1;
-    # $index is quoted to avoid perl version differences
-    return [ "$index", 'a','b','c' ];
+    # There doesn't seem any reliable way to force $index to be
+    # treated as a string (and so dumped as such).  We just have to
+    # make the test case allow either 1 or '1'.
+    #
+    return [ $index, 'a','b','c' ];
 };
 @$rows = ();
 ok( $sth->execute_array({
@@ -86,7 +89,8 @@
 ok( @$rows, 2 );
 ok( @$tuple_status, 2 );
 $dumped = Dumper($rows);
-ok( $dumped, "[['1','a','b','c'],['2','a','b','c']]");
+$dumped =~ s/'(\d)'/$1/g;
+ok( $dumped, "[[1,'a','b','c'],[2,'a','b','c']]");
 $dumped = Dumper($tuple_status);
 ok( $dumped, "[1,1]");
 

Greg Earle pointed me to
<http://groups.google.com/groups?selm=20030530211041.GC27707%40dansat.data-plan.com&output=gplain>
which gives a possible fix for the test failure, but it seems that no
matter how hard you try to make $index a string, something along the
line (perhaps Data::Dumper) reserves the right to treat it as a
number.  The only reasonable fix, it seems, is for the test suite to
accept both syntaxes.

-- 
Ed Avis <[EMAIL PROTECTED]>

Reply via email to