aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Kehayias <john.kehayias@protonmail.com>2023-11-26 11:12:59 -0500
committerJohn Kehayias <john.kehayias@protonmail.com>2023-11-26 11:12:59 -0500
commitd15ffea6f47a40a9d36f3f32935e63f92e90af03 (patch)
tree826b3be17acf0f680e7888b3f7a3eeeaaedded7d /tests
parent8d2a5a36af4c36dfa08c7ee75d7a06ebb7a8225a (diff)
parent176440c056fdde6da98b11720989b1ed060ec97c (diff)
downloadguix-d15ffea6f47a40a9d36f3f32935e63f92e90af03.tar.gz
guix-d15ffea6f47a40a9d36f3f32935e63f92e90af03.zip
Merge branch 'master' into mesa-updates
Change-Id: Ide02272218e76dfae6dc9f8748871c8d61704260
Diffstat (limited to 'tests')
-rw-r--r--tests/gexp.scm59
-rw-r--r--tests/read-print.scm5
-rw-r--r--tests/syscalls.scm10
3 files changed, 41 insertions, 33 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 7a90f8dcbf..0e3c446576 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021-2022 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
@@ -826,38 +826,39 @@
(call-with-output-file (string-append #$output "/two")
(lambda (port)
(display "This is the second one." port))))))
- (build-drv #~(begin
- (use-modules (guix build store-copy)
- (guix build utils)
- (srfi srfi-1))
-
- (define (canonical-file? file)
- ;; Copied from (guix tests).
- (let ((st (lstat file)))
- (or (not (string-prefix? (%store-directory) file))
- (eq? 'symlink (stat:type st))
- (and (= 1 (stat:mtime st))
- (zero? (logand #o222 (stat:mode st)))))))
-
- (mkdir #$output)
- (populate-store '("graph") #$output
- #:deduplicate? #f)
-
- ;; Check whether 'populate-store' canonicalizes
- ;; permissions and timestamps.
- (unless (every canonical-file? (find-files #$output))
- (error "not canonical!" #$output)))))
+ (build-drv
+ (with-imported-modules '((guix build store-copy)
+ (guix build syscalls)
+ (guix progress)
+ (guix records)
+ (guix sets)
+ (guix build utils))
+ #~(begin
+ (use-modules (guix build store-copy)
+ (guix build utils)
+ (srfi srfi-1))
+
+ (define (canonical-file? file)
+ ;; Copied from (guix tests).
+ (let ((st (lstat file)))
+ (or (not (string-prefix? (%store-directory) file))
+ (eq? 'symlink (stat:type st))
+ (and (= 1 (stat:mtime st))
+ (zero? (logand #o222 (stat:mode st)))))))
+
+ (mkdir #$output)
+ (populate-store '("graph") #$output
+ #:deduplicate? #f)
+
+ ;; Check whether 'populate-store' canonicalizes
+ ;; permissions and timestamps.
+ (unless (every canonical-file? (find-files #$output))
+ (error "not canonical!" #$output))))))
(mlet* %store-monad ((one (gexp->derivation "one" build-one))
(two (gexp->derivation "two" (build-two one)))
(drv (gexp->derivation "store-copy" build-drv
#:references-graphs
- `(("graph" ,two))
- #:modules
- '((guix build store-copy)
- (guix progress)
- (guix records)
- (guix sets)
- (guix build utils))))
+ `(("graph" ,two))))
(ok? (built-derivations (list drv)))
(out -> (derivation->output-path drv)))
(let ((one (derivation->output-path one))
diff --git a/tests/read-print.scm b/tests/read-print.scm
index c8b8eb73fe..c1006a8a68 100644
--- a/tests/read-print.scm
+++ b/tests/read-print.scm
@@ -174,6 +174,11 @@ expressions."
(else #f))")
(test-pretty-print "\
+(parameterize ((a 1)
+ (b 2))
+ (call f g h))")
+
+(test-pretty-print "\
#~(string-append #$coreutils \"/bin/uname\")")
(test-pretty-print "\
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index eb85b358c4..340c1147de 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -583,11 +583,13 @@
(test-assert "terminal-rows"
(> (terminal-rows) 0))
-(test-assert "terminal-string-width English"
- (= (terminal-string-width "hello") 5))
+(test-equal "terminal-string-width English"
+ 5
+ (terminal-string-width "hello"))
-(test-assert "terminal-string-width Japanese"
- (= (terminal-string-width "今日は") 6))
+(test-equal "terminal-string-width Japanese"
+ 6
+ (terminal-string-width "今日は"))
(test-assert "openpty"
(let ((head inferior (openpty)))