File: test_fix_endcopy.patch

package info (click to toggle)
libpg-perl 1%3A2.1.1-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 228 kB
  • ctags: 36
  • sloc: perl: 514; ansic: 112; makefile: 7; sh: 7
file content (22 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: Fix $conn->endcopy test
 PQendcopy() fails with "no COPY in progress" after copying is done. Adjust
 test case to ensure that, instead of expecting it to succeed.
Author: Martin Pitt <mpitt@debian.org>
Last-Update: 2014-07-29

--- libpg-perl-2.1.1.orig/test.pl
+++ libpg-perl-2.1.1/test.pl
@@ -183,10 +183,11 @@ while (-1 != $ret) {
     and print "\$conn->getline .......... ok\n"
     or  print "\$conn->getline .......... not ok: $string\n";
 
+# should be "no COPY in progress" now
 $ret = $conn->endcopy;
-( 0 == $ret )
+( 1 == $ret )
     and print "\$conn->endcopy .......... ok\n"
-    or  print "\$conn->endcopy .......... not ok: $ret\n";
+    or  print "\$conn->endcopy .......... not ok: $ret ", $conn->errorMessage, "\n";
 
 ######################### delete and copy from stdin, PQputline