gnu: lvm2: Make sure compiled objects are stripped.
[jackhill/guix/guix.git] / tests / cpan.scm
index 2f95135..80ff044 100644 (file)
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix base32)
   #:use-module (guix hash)
   #:use-module (guix tests)
+  #:use-module (guix grafts)
   #:use-module (srfi srfi-64)
   #:use-module (ice-9 match))
 
+;; Globally disable grafts because they can trigger early builds.
+(%graft? #f)
+
 (define test-json
   "{
   \"metadata\" : {
@@ -44,7 +49,7 @@
   ],
   \"abstract\" : \"Fizzle Fuzz\",
   \"download_url\" : \"http://example.com/Foo-Bar-0.1.tar.gz\",
-  \"author\" : \"GUIX\",
+  \"author\" : \"Guix\",
   \"version\" : \"0.1\"
 }")
 
@@ -61,9 +66,9 @@
              (lambda ()
                (display
                 (match url
-                  ("http://api.metacpan.org/release/Foo-Bar"
+                  ("https://api.metacpan.org/release/Foo-Bar"
                    test-json)
-                  ("http://api.metacpan.org/module/Test::Script"
+                  ("https://api.metacpan.org/module/Test::Script"
                    "{ \"distribution\" : \"Test-Script\" }")
                   ("http://example.com/Foo-Bar-0.1.tar.gz"
                    test-source)
       (x
        (pk 'fail x #f)))))
 
-(test-end "cpan")
+(test-equal "source-url-http"
+  ((@@ (guix import cpan) fix-source-url)
+   "http://cpan.metacpan.org/authors/id/T/TE/TEST/Foo-Bar-0.1.tar.gz")
+  "mirror://cpan/authors/id/T/TE/TEST/Foo-Bar-0.1.tar.gz")
 
-\f
-(exit (= (test-runner-fail-count (test-runner-current)) 0))
+(test-equal "source-url-https"
+  ((@@ (guix import cpan) fix-source-url)
+   "https://cpan.metacpan.org/authors/id/T/TE/TEST/Foo-Bar-0.1.tar.gz")
+  "mirror://cpan/authors/id/T/TE/TEST/Foo-Bar-0.1.tar.gz")
+
+(test-end "cpan")