[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/04: gexp: Add 'local-file' file name resolution test.
From: |
Ludovic Courtès |
Subject: |
04/04: gexp: Add 'local-file' file name resolution test. |
Date: |
Thu, 16 Jun 2016 07:36:29 +0000 (UTC) |
civodul pushed a commit to branch master
in repository guix.
commit 4ff76a0a346e2b7e351d6c14da3484692f1c20e7
Author: Ludovic Courtès <address@hidden>
Date: Thu Jun 16 09:33:24 2016 +0200
gexp: Add 'local-file' file name resolution test.
* tests/gexp.scm ("local-file, relative file name"): New test.
---
tests/gexp.scm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tests/gexp.scm b/tests/gexp.scm
index f504b92..f44f0ea 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)