diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cache.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/cache.scm b/tests/cache.scm index 80b44d69aad..d495ace2bd7 100644 --- a/tests/cache.scm +++ b/tests/cache.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2017, 2020 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2017, 2020 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -74,6 +75,20 @@ | |||
| 74 | (lambda (port) | 75 | (lambda (port) |
| 75 | (display 0 port))))) | 76 | (display 0 port))))) |
| 76 | 77 | ||
| 78 | (test-equal "maybe-remove-expired-cache-entries, empty cache" | ||
| 79 | '("a" "b" "c") | ||
| 80 | (test-cache-cleanup cache | ||
| 81 | (call-with-output-file (string-append cache "/last-expiry-cleanup") | ||
| 82 | (lambda (port) | ||
| 83 | (display "" port))))) | ||
| 84 | |||
| 85 | (test-equal "maybe-remove-expired-cache-entries, corrupted cache" | ||
| 86 | '("a" "b" "c") | ||
| 87 | (test-cache-cleanup cache | ||
| 88 | (call-with-output-file (string-append cache "/last-expiry-cleanup") | ||
| 89 | (lambda (port) | ||
| 90 | (display "1\"34657890" port))))) | ||
| 91 | |||
| 77 | (test-end "cache") | 92 | (test-end "cache") |
| 78 | 93 | ||
| 79 | ;;; Local Variables: | 94 | ;;; Local Variables: |
