summary refs log tree commit diff
path: root/tests/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-04-26 16:43:08 +0200
committerLudovic Courtès <ludo@gnu.org>2013-04-26 16:43:08 +0200
commita9db7d10b6e4e86fb2b87a4161db3b1f202002fd (patch)
tree4a22481ab65447d8bc1cc307a76a884a7e7bbee9 /tests/packages.scm
parente33d9d6f09874f83bb5a03f49cb969a84588e10e (diff)
parent2b6bdf7eb3c95716ac107ea6caea2e0b7077ae77 (diff)
downloadguix-a9db7d10b6e4e86fb2b87a4161db3b1f202002fd.tar.gz
Merge branch 'master' into core-updates
Conflicts:
	Makefile.am
	gnu/packages/autotools.scm
	gnu/packages/guile.scm
	gnu/packages/python.scm
	gnu/packages/shishi.scm
	guix/gnu-maintenance.scm
	guix/scripts/build.scm
	guix/scripts/gc.scm
	guix/scripts/package.scm
	guix/scripts/substitute-binary.scm
	guix/ui.scm
	nix/nix-daemon/guix-daemon.cc
	test-env.in
	tests/nar.scm
	tests/store.scm
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index 2d16f8a03f..1dd7b91ae8 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -53,6 +53,28 @@
            (home-page #f) (license #f)
            extra-fields ...))
 
+(test-assert "package-field-location"
+  (let ()
+    (define (goto port line column)
+      (unless (and (= (port-column port) (- column 1))
+                   (= (port-line port) (- line 1)))
+        (unless (eof-object? (get-char port))
+          (goto port line column))))
+
+    (define read-at
+      (match-lambda
+       (($ <location> file line column)
+        (call-with-input-file (search-path %load-path file)
+          (lambda (port)
+            (goto port line column)
+            (read port))))))
+
+    (and (equal? (read-at (package-field-location %bootstrap-guile 'name))
+                 (package-name %bootstrap-guile))
+         (equal? (read-at (package-field-location %bootstrap-guile 'version))
+                 (package-version %bootstrap-guile))
+         (not (package-field-location %bootstrap-guile 'does-not-exist)))))
+
 (test-assert "package-transitive-inputs"
   (let* ((a (dummy-package "a"))
          (b (dummy-package "b"