summaryrefslogtreecommitdiff
path: root/tests/cache.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-06-08 14:53:16 +0200
committerLudovic Courtès <ludo@gnu.org>2022-06-08 14:53:16 +0200
commit091eb323ba2787ce64a1fb2796e7e06dbee6037c (patch)
tree446a869245541bd48f303caef76e4c24f6e7d0bb /tests/cache.scm
parent05fef7bfc60058763f5a64ec0feaf3876b56281d (diff)
parent0c5299200ffcd16370f047b7ccb187c60f30da34 (diff)
downloadguix-patches-091eb323ba2787ce64a1fb2796e7e06dbee6037c.tar
guix-patches-091eb323ba2787ce64a1fb2796e7e06dbee6037c.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'tests/cache.scm')
-rw-r--r--tests/cache.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/cache.scm b/tests/cache.scm
index 80b44d69aa..d495ace2bd 100644
--- a/tests/cache.scm
+++ b/tests/cache.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -74,6 +75,20 @@
(lambda (port)
(display 0 port)))))
+(test-equal "maybe-remove-expired-cache-entries, empty cache"
+ '("a" "b" "c")
+ (test-cache-cleanup cache
+ (call-with-output-file (string-append cache "/last-expiry-cleanup")
+ (lambda (port)
+ (display "" port)))))
+
+(test-equal "maybe-remove-expired-cache-entries, corrupted cache"
+ '("a" "b" "c")
+ (test-cache-cleanup cache
+ (call-with-output-file (string-append cache "/last-expiry-cleanup")
+ (lambda (port)
+ (display "1\"34657890" port)))))
+
(test-end "cache")
;;; Local Variables: