summary refs log tree commit diff
path: root/tests/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-07-16 11:40:34 +0200
committerLudovic Courtès <ludo@gnu.org>2018-07-19 11:48:04 +0200
commite529d46828c359b449fc570bdc293fc12534647c (patch)
tree2d6127bccc33d4f90baf8da1f6778dc5fadbd2e3 /tests/gexp.scm
parent8df2eca6b0915942ea087d7c5981514c532d47a2 (diff)
downloadguix-e529d46828c359b449fc570bdc293fc12534647c.tar.gz
gexp: 'imported-files/derivation' can copy files instead of symlinking.
* guix/gexp.scm (imported-files/derivation): Add #:symlink? and honor
it.
(imported-files): Pass #:symlink? to 'imported-files/derivation'.
* tests/gexp.scm ("imported-files with file-like objects"): Add 'file=?'
and use it instead of calling 'readlink'.
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r--tests/gexp.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index c89d0c4855..b22e635805 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -652,16 +652,19 @@
                        (files -> `(("a/b/c" . ,q-scm)
                                    ("p/q"   . ,plain)))
                        (drv      (imported-files files)))
+    (define (file=? file1 file2)
+      ;; Assume deduplication is in place.
+      (= (stat:ino (lstat file1))
+         (stat:ino (lstat file2))))
+
     (mbegin %store-monad
       (built-derivations (list drv))
       (mlet %store-monad ((dir -> (derivation->output-path drv))
                           (plain* (text-file "foo" "bar!"))
                           (q-scm* (interned-file q-scm "c")))
         (return
-         (and (string=? (readlink (string-append dir "/a/b/c"))
-                        q-scm*)
-              (string=? (readlink (string-append dir "/p/q"))
-                        plain*)))))))
+         (and (file=? (string-append dir "/a/b/c") q-scm*)
+              (file=? (string-append dir "/p/q") plain*)))))))
 
 (test-equal "gexp-modules & ungexp"
   '((bar) (foo))