From 0504fe76bca2d59e1f0bdf535d42e02fec677f10 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Tue, 12 Oct 2021 08:47:18 +0200 Subject: Fix tests for newer server versions which report no "micro" version Reported by Kon Lovett --- tests/run.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests') 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" -- cgit v1.2.3