diff --git a/tests/file-systems.scm b/tests/file-systems.scm index 1c58454fa23..cffe70375b0 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 27bec57325f..76b4e5dc55a 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 82fb7a96cea..1f69f14cdcd 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 +;;; Copyright © 2012-2021, 2023, 2025-2026 Ludovic Courtès ;;; ;;; 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 09e577677d7..bc918a68bbd 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 955a9967b21..b40129f393a 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 . +(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]]