summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-12-26 16:03:09 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-12-26 16:03:09 +0100
commit2bfcdbce51cf09a856ac0e43bb1a554b0110e1df (patch)
tree9d6a801ec5d6ccedf4ad600e8748b8c9d24315c7 /tests
parente99d036828bd7d01bfd108f3d5a2f7de61fab32d (diff)
parent10275b7466853fce6d5b925f0267c20c304ba25a (diff)
downloadguix-2bfcdbce51cf09a856ac0e43bb1a554b0110e1df.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'tests')
-rw-r--r--tests/lint.scm28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 300153e24e..d4aa7c0e8e 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -669,6 +670,33 @@
        (check-mirror-url (dummy-package "x" (source source)))))
    "mirror://gnu/foo/foo.tar.gz"))
 
+(test-assert "github-url"
+  (string-null?
+   (with-warnings
+     (with-http-server 200 %long-string
+       (check-github-url
+        (dummy-package "x" (source
+                            (origin
+                              (method url-fetch)
+                              (uri (%local-url))
+                              (sha256 %null-sha256)))))))))
+
+(let ((github-url "https://github.com/foo/bar/bar-1.0.tar.gz"))
+  (test-assert "github-url: one suggestion"
+    (string-contains
+     (with-warnings
+       (with-http-server (301 `((location . ,(string->uri github-url)))) ""
+         (let ((initial-uri (%local-url)))
+           (parameterize ((%http-server-port (+ 1 (%http-server-port))))
+             (with-http-server (302 `((location . ,(string->uri initial-uri)))) ""
+               (check-github-url
+                (dummy-package "x" (source
+                                    (origin
+                                      (method url-fetch)
+                                      (uri (%local-url))
+                                      (sha256 %null-sha256))))))))))
+     github-url)))
+
 (test-assert "cve"
   (mock ((guix scripts lint) package-vulnerabilities (const '()))
         (string-null?