| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015, 2021 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; |
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 7 | ;;; under the terms of the GNU General Public License as published by |
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 9 | ;;; your option) any later version. |
| 10 | ;;; |
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ;;; GNU General Public License for more details. |
| 15 | ;;; |
| 16 | ;;; You should have received a copy of the GNU General Public License |
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | (define-module (test-gnu-maintenance) |
| 20 | #:use-module (guix gnu-maintenance) |
| 21 | #:use-module (srfi srfi-1) |
| 22 | #:use-module (srfi srfi-64) |
| 23 | #:use-module (ice-9 match)) |
| 24 | |
| 25 | (test-begin "gnu-maintenance") |
| 26 | |
| 27 | (test-assert "release-file?" |
| 28 | (and (every (lambda (project+file) |
| 29 | (apply release-file? project+file)) |
| 30 | '(("gcc" "gcc-5.3.0.tar.bz2") |
| 31 | ("texmacs" "TeXmacs-1.0.7.9-src.tar.gz") |
| 32 | ("icecat" "icecat-38.4.0-gnu1.tar.bz2") |
| 33 | ("mit-scheme" "mit-scheme-9.2.tar.gz") |
| 34 | ("mediainfo" "mediainfo_20.09.tar.xz") |
| 35 | ("exiv2" "exiv2-0.27.3-Source.tar.gz") |
| 36 | ("mpg321" "mpg321_0.3.2.orig.tar.gz") |
| 37 | ("bvi" "bvi-1.4.1.src.tar.gz") |
| 38 | ("hostscope" "hostscope-V2.1.tgz"))) |
| 39 | (every (lambda (project+file) |
| 40 | (not (apply release-file? project+file))) |
| 41 | '(("guile" "guile-www-1.1.1.tar.gz") |
| 42 | ("guile" "guile-2.0.11.tar.gz.sig") |
| 43 | ("mit-scheme" "mit-scheme-9.2-i386.tar.gz") |
| 44 | ("mit-scheme" "mit-scheme-9.2-doc-pdf.tar.gz") |
| 45 | ("gnutls" "gnutls-3.2.18-w32.zip"))))) |
| 46 | |
| 47 | (test-assert "tarball->version" |
| 48 | (let ((tarball->version (@@ (guix gnu-maintenance) tarball->version))) |
| 49 | (every (match-lambda |
| 50 | ((file version) |
| 51 | (equal? (tarball->version file) version))) |
| 52 | '(("coreutils-8.32.tar.gz" "8.32") |
| 53 | ("mediainfo_20.09.tar.xz" "20.09") |
| 54 | ("exiv2-0.27.3-Source.tar.gz" "0.27.3") |
| 55 | ("mpg321_0.3.2.orig.tar.gz" "0.3.2") |
| 56 | ("bvi-1.4.1.src.tar.gz" "1.4.1"))))) |
| 57 | |
| 58 | (test-end) |