summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-01-03 22:15:15 +0100
committerRutherther <rutherther@ditigal.xyz>2026-01-25 21:23:25 +0100
commitd118a89d62ef1e85199f90a1267e555b49d38ee8 (patch)
tree8b88ea5d9977e05d8c37d1bd72f772575e22c446 /tests
parent64acb4e65d32299e4547f6432bff1ffb74d27699 (diff)
tests: Adjust to Guile 3.0.10+.
Guile 3.0.11 introduced a new implementation of (srfi srfi-34) with subtle changes wrt. exceptionm handling. This adjusts to these changes. Changes in ‘tests/style.scm’ are due to the new output of (ice-9 pretty-print) in 3.0.10. * tests/file-systems.scm ("btrfs-store-subvolume-file-name (subvolid)"): Specify the exception type. * tests/services/file-sharing.scm ("transmission-password-hash, salt value too short") ("transmission-password-hash, salt value too long"): Likewise. * tests/store.scm ("store-path-package-name #f"): Change to ‘test-error’ with #t as the exception type. * tests/style.scm: Skip all the tests on Guile > 3.0.9. * tests/toml.scm <top level>: Set ‘raise’ in (guix build toml). ("parse-toml: No key"): Use ‘test-error’ instead of ‘test-equal’. ("parse-toml: Assignment to non-table"): Likewise. ("parse-toml: Invalid assignment to implicit table"): Change exception type to #t ("parse-toml: Assignment to statically defined array"): Likewise. Change-Id: I54ea77f22d3e95f72dad90690631876e7f013054 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Signed-off-by: Rutherther <rutherther@ditigal.xyz>
Diffstat (limited to 'tests')
-rw-r--r--tests/file-systems.scm2
-rw-r--r--tests/services/file-sharing.scm3
-rw-r--r--tests/store.scm6
-rw-r--r--tests/style.scm12
-rw-r--r--tests/toml.scm16
5 files changed, 29 insertions, 10 deletions
diff --git a/tests/file-systems.scm b/tests/file-systems.scm
index 1c58454fa2..cffe70375b 100644
--- a/tests/file-systems.scm
+++ b/tests/file-systems.scm
@@ -22,6 +22,7 @@
#:use-module (guix modules)
#:use-module (gnu system file-systems)
#:use-module (srfi srfi-1)
+ #:use-module ((srfi srfi-35) #:select (&message))
#:use-module (srfi srfi-64)
#:use-module (ice-9 match))
@@ -124,6 +125,7 @@
%btrfs-store-subvolume))))
(test-error "btrfs-store-subvolume-file-name (subvolid)"
+ &message
(parameterize ((%store-prefix "/gnu/store"))
(btrfs-store-subvolume-file-name (list %btrfs-root-subvolume
%btrfs-store-subvolid))))
diff --git a/tests/services/file-sharing.scm b/tests/services/file-sharing.scm
index 27bec57325..76b4e5dc55 100644
--- a/tests/services/file-sharing.scm
+++ b/tests/services/file-sharing.scm
@@ -18,6 +18,7 @@
(define-module (tests services file-sharing)
#:use-module (gnu services file-sharing)
+ #:use-module ((guix diagnostics) #:select (formatted-message?))
#:use-module (srfi srfi-64))
;;; Tests for the (gnu services file-sharing) module.
@@ -47,11 +48,13 @@
(transmission-password-hash "" "Cp.I5SWg"))
(test-error "transmission-password-hash, salt value too short"
+ formatted-message?
(transmission-password-hash
"transmission"
(make-string (- %transmission-salt-length 1) #\a)))
(test-error "transmission-password-hash, salt value too long"
+ formatted-message?
(transmission-password-hash
"transmission"
(make-string (+ %transmission-salt-length 1) #\a)))
diff --git a/tests/store.scm b/tests/store.scm
index 82fb7a96ce..1f69f14cdc 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012-2021, 2023, 2025 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012-2021, 2023, 2025-2026 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -94,8 +94,8 @@
(string-append (%store-prefix)
"/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
-(test-equal "store-path-package-name #f"
- #f
+(test-error "store-path-package-name #f"
+ #t ;any exception
(store-path-package-name
"/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7"))
diff --git a/tests/style.scm b/tests/style.scm
index 09e577677d..bc918a68bb 100644
--- a/tests/style.scm
+++ b/tests/style.scm
@@ -20,7 +20,9 @@
#:use-module ((gcrypt hash) #:select (port-sha256))
#:use-module (guix packages)
#:use-module (guix scripts style)
- #:use-module ((guix utils) #:select (call-with-temporary-directory))
+ #:use-module ((guix utils)
+ #:select (guile-version>?
+ call-with-temporary-directory))
#:use-module ((guix build utils) #:select (substitute*))
#:use-module (guix gexp) ;for the reader extension
#:use-module (guix diagnostics)
@@ -136,6 +138,14 @@
(test-begin "style")
+(when (guile-version>? "3.0.9")
+ ;; The output of 'pretty-print' changed in Guile 3.0.10. These tests are
+ ;; currently written against the output of 'pretty-print' from 3.0.9, so
+ ;; skip them when running on a newer version.
+ ;;
+ ;; TODO: Adjust tests for 3.0.10+.
+ (test-skip 1000))
+
(test-equal "nothing to rewrite"
'()
(with-test-package '()
diff --git a/tests/toml.scm b/tests/toml.scm
index 955a9967b2..b40129f393 100644
--- a/tests/toml.scm
+++ b/tests/toml.scm
@@ -23,6 +23,10 @@
#:use-module (srfi srfi-64)
#:use-module (ice-9 match))
+;; Work around <https://codeberg.org/guix/guix/issues/5339>.
+(module-set! (resolve-module '(guix build toml))
+ 'raise (@ (srfi srfi-34) raise))
+
(test-begin "toml")
;; Tests taken from https://toml.io/en/v1.0.0
@@ -60,8 +64,8 @@ bare-key = \"value\"
(parse-toml "\"key \\\\ with \\n escapes\" = \"value\"
key.\"with \\t escapes\".\"and \\n dots\" = \"value\""))
-(test-equal "parse-toml: No key"
- #f
+(test-error "parse-toml: No key"
+ &file-not-consumed
(parse-toml "= \"no key name\""))
(test-equal "parse-toml: Empty key"
@@ -381,8 +385,8 @@ apple = \"red\"
[fruit]
orange = \"orange\""))
-(test-equal "parse-toml: Assignment to non-table"
- #f
+(test-error "parse-toml: Assignment to non-table"
+ #t
(parse-toml "[fruit]
apple = \"red\"
@@ -419,7 +423,7 @@ type.edible = false # INVALID"))
;; We do not catch this semantic error yet.
(test-expect-fail 1)
(test-error "parse-toml: Invalid assignment to implicit table"
- #f
+ #t
(parse-toml "[product]
type.name = \"Nail\"
type = { edible = false } # INVALID"))
@@ -473,7 +477,7 @@ name = \"plantain\""))
;; Not implemented.
(test-expect-fail 1)
(test-error "parse-toml: Assignment to statically defined array"
- #f
+ #t
(parse-toml "fruits = []
[[fruits]]