diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/import/utils.scm | 9 | ||||
| -rw-r--r-- | tests/style.scm | 37 |
2 files changed, 45 insertions, 1 deletions
diff --git a/tests/import/utils.scm b/tests/import/utils.scm index b631ba23268..c82fef78ec7 100644 --- a/tests/import/utils.scm +++ b/tests/import/utils.scm @@ -344,4 +344,13 @@ error procedure has been called." (let ((sexp error-called? (test-generate-git-source "1.0.0" "2.0.0"))) error-called?)) +(test-equal "tarball-url->git-repository-url, guile" + '("https://https.git.savannah.gnu.org/git/guile.git" + "https://gitlab.gnome.org/GNOME/brasero.git" + "https://github.com/aide/aide") + (map tarball-url->git-repository-url + '("mirror://gnu/guile/guile-3.0.11.tar.gz" + "mirror://gnome/sources/brasero/3.12/brasero-3.12.3.tar.xz" + "https://github.com/aide/aide/releases/download/v0.19.3/aide-0.19.3.tar.gz"))) + (test-end "import-utils") diff --git a/tests/style.scm b/tests/style.scm index bc918a68bbd..350feed22b0 100644 --- a/tests/style.scm +++ b/tests/style.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021-2024 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2021-2024, 2026 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -669,6 +669,41 @@ (cut string-contains <> "patches"))))))) "1")) +(unless (false-if-exception + (getaddrinfo "https.git.savannah.gnu.org" "https")) + (test-skip 1)) +(test-equal "url-fetch->git-fetch, mirror:// URL" + '(origin + (method git-fetch) + (uri (git-reference + (url "https://https.git.savannah.gnu.org/git/sed.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "00p6v3aa22jz365scmifr06fspkylzrvbqda0waz4x06q5qv0263"))) + (call-with-test-package + '((version "4.9") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/sed/sed-" + version ".tar.gz")) + (sha256 + (base32 "0000000000000000000000000000000000000000000000000000"))))) + (lambda (directory) + (define file + (string-append directory "/my-packages-1.scm")) + + ;; Note: This ends up cloning the 'sed' repository on Savannah. + (system* "guix" "style" "-L" directory "-S" "git-source" "my-coreutils-1") + + (load file) + (call-with-input-string (read-package-field + (@ (my-packages-1) my-coreutils-1) 'source 8) + read)) + "1")) + (test-assert "url-fetch->git-fetch, non-git home-page unchanged" (call-with-test-package '((home-page "https://www.example.com") |
