summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/builders.scm21
-rw-r--r--tests/monads.scm3
-rw-r--r--tests/packages.scm6
-rw-r--r--tests/store.scm8
4 files changed, 23 insertions, 15 deletions
diff --git a/tests/builders.scm b/tests/builders.scm
index 579246d04d..e5acc3e038 100644
--- a/tests/builders.scm
+++ b/tests/builders.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -59,6 +59,9 @@
(define network-reachable?
(false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)))
+(define url-fetch*
+ (store-lower url-fetch))
+
(test-begin "builders")
@@ -68,8 +71,8 @@
"ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))
(hash (nix-base32-string->bytevector
"0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
- (drv (url-fetch %store url 'sha256 hash
- #:guile %bootstrap-guile))
+ (drv (url-fetch* %store url 'sha256 hash
+ #:guile %bootstrap-guile))
(out-path (derivation->output-path drv)))
(and (build-derivations %store (list drv))
(file-exists? out-path)
@@ -78,16 +81,16 @@
(test-assert "url-fetch, file"
(let* ((file (search-path %load-path "guix.scm"))
(hash (call-with-input-file file port-sha256))
- (out (url-fetch %store file 'sha256 hash)))
+ (out (url-fetch* %store file 'sha256 hash)))
(and (file-exists? out)
(valid-path? %store out))))
(test-assert "url-fetch, file URI"
(let* ((file (search-path %load-path "guix.scm"))
(hash (call-with-input-file file port-sha256))
- (out (url-fetch %store
- (string-append "file://" (canonicalize-path file))
- 'sha256 hash)))
+ (out (url-fetch* %store
+ (string-append "file://" (canonicalize-path file))
+ 'sha256 hash)))
(and (file-exists? out)
(valid-path? %store out))))
@@ -99,8 +102,8 @@
(let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
(hash (nix-base32-string->bytevector
"0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
- (tarball (url-fetch %store url 'sha256 hash
- #:guile %bootstrap-guile))
+ (tarball (url-fetch* %store url 'sha256 hash
+ #:guile %bootstrap-guile))
(build (gnu-build %store "hello-2.8"
`(("source" ,tarball)
,@%bootstrap-inputs)
diff --git a/tests/monads.scm b/tests/monads.scm
index 9c3cdd20a7..347a255072 100644
--- a/tests/monads.scm
+++ b/tests/monads.scm
@@ -21,8 +21,7 @@
#:use-module (guix store)
#:use-module (guix monads)
#:use-module (guix derivations)
- #:use-module ((guix packages)
- #:select (package-derivation %current-system))
+ #:use-module (guix packages)
#:use-module (gnu packages)
#:use-module (gnu packages bootstrap)
#:use-module ((gnu packages base) #:select (coreutils))
diff --git a/tests/packages.scm b/tests/packages.scm
index 72c69ff653..bd5ba3ee92 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -182,10 +182,10 @@
(let* ((file (search-bootstrap-binary "guile-2.0.9.tar.xz"
(%current-system)))
(sha256 (call-with-input-file file port-sha256))
- (fetch (lambda* (store url hash-algo hash
+ (fetch (lambda* (url hash-algo hash
#:optional name #:key system)
(pk 'fetch url hash-algo hash name system)
- (add-to-store store (basename url) #f "sha256" url)))
+ (interned-file url)))
(source (bootstrap-origin
(origin
(method fetch)
diff --git a/tests/store.scm b/tests/store.scm
index cb5370d5cc..f43fcb14d0 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -595,6 +595,12 @@ Deriver: ~a~%"
(null? (valid-derivers %store file))
(null? (referrers %store file))))))
+(test-equal "store-lower"
+ "Lowered."
+ (let* ((add (store-lower text-file))
+ (file (add %store "foo" "Lowered.")))
+ (call-with-input-file file get-string-all)))
+
(test-end "store")