aboutsummaryrefslogtreecommitdiff
path: root/tests/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-06-16 09:33:24 +0200
committerLudovic Courtès <ludo@gnu.org>2016-06-16 09:34:37 +0200
commit4ff76a0a346e2b7e351d6c14da3484692f1c20e7 (patch)
tree1b2577cc2d4ff5902308573560a0e38c5e5d690f /tests/gexp.scm
parent0687fc9cd98e38feab80e2f9c8044e77ad52c7fd (diff)
downloadguix-4ff76a0a346e2b7e351d6c14da3484692f1c20e7.tar
guix-4ff76a0a346e2b7e351d6c14da3484692f1c20e7.tar.gz
gexp: Add 'local-file' file name resolution test.
* tests/gexp.scm ("local-file, relative file name"): New test.
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r--tests/gexp.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index f504b92d84..f44f0eaf9a 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -24,6 +24,7 @@
#:use-module (guix derivations)
#:use-module (guix packages)
#:use-module (guix tests)
+ #:use-module ((guix build utils) #:select (with-directory-excursion))
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages bootstrap)
@@ -133,6 +134,14 @@
(lambda ()
(false-if-exception (delete-file link))))))
+(test-equal "local-file, relative file name"
+ (canonicalize-path (search-path %load-path "guix/base32.scm"))
+ (let ((directory (dirname (search-path %load-path
+ "guix/build-system/gnu.scm"))))
+ (with-directory-excursion directory
+ (let ((file (local-file "../guix/base32.scm")))
+ (local-file-absolute-file-name file)))))
+
(test-assertm "local-file, #:select?"
(mlet* %store-monad ((select? -> (lambda (file stat)
(member (basename file)