summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2021-10-12 08:47:18 +0200
committerPeter Bex <peter@more-magic.net>2021-10-12 08:47:18 +0200
commit0504fe76bca2d59e1f0bdf535d42e02fec677f10 (patch)
tree0fe3a86d49e718bad7b402190a295df93558b8d0
parent790f215b2befa2d4022f40425b474557479b9f35 (diff)
downloadchicken-postgresql-4.1.4.tar.gz
Fix tests for newer server versions which report no "micro" version4.1.4
Reported by Kon Lovett
-rw-r--r--tests/run.scm13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/run.scm b/tests/run.scm
index c370cbe..21daa09 100644
--- a/tests/run.scm
+++ b/tests/run.scm
@@ -62,11 +62,14 @@
;; In the tests, we assume that the client lib is at least equal to
;; the server's version.
-(define-values (major-version minor-version micro-version)
- (apply values
- (map string->number
- (string-split
- (value-at (query conn "SHOW server_version")) "."))))
+(define-values (major-version minor-version)
+ (let ((versions (map string->number
+ (string-split
+ (value-at (query conn "SHOW server_version")) "."))))
+ ;; NOTE: Sometimes there are two, sometimes three values.
+ ;; We don't really care about the "micro" version here,
+ ;; so just return the first two and treat them as major/minor.
+ (values (car versions) (cadr versions))))
(test-group "low-level interface"
(test-assert "query returns result"