diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-01-09 22:09:58 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-01-09 22:10:06 +0100 |
commit | b2d58cd80a04ccab09a947d187ae55ff199eae08 (patch) | |
tree | 0fc47cbad22bb432f4eee5db386e5bacbab52ca1 /tests/union.scm | |
parent | b9e5c0a949fa627da55ea53fd71dfa96ad8a2b4b (diff) | |
download | guix-b2d58cd80a04ccab09a947d187ae55ff199eae08.tar guix-b2d58cd80a04ccab09a947d187ae55ff199eae08.tar.gz |
union: Detect collisions, and delete duplicate leaves.
* guix/build/union.scm (delete-duplicate-leaves): New procedure.
(union-build)[leaf=?, resolve-collision]: New procedures.
Use `delete-duplicate-leaves' on the result of `tree-union'.
* tests/union.scm ("delete-duplicate-leaves, default",
"delete-duplicate-leaves, file names"): New tests.
Diffstat (limited to 'tests/union.scm')
-rw-r--r-- | tests/union.scm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/union.scm b/tests/union.scm index 317d49dc35..a3859434a2 100644 --- a/tests/union.scm +++ b/tests/union.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -64,6 +64,25 @@ (bin make) (share (doc (make README)))))) +(test-equal "delete-duplicate-leaves, default" + '(bin make touch ls) + (delete-duplicate-leaves '(bin ls make touch ls))) + +(test-equal "delete-duplicate-leaves, file names" + '("doc" ("info" + "/binutils/ld.info" + "/gcc/gcc.info" + "/binutils/standards.info")) + (let ((leaf=? (lambda (a b) + (string=? (basename a) (basename b))))) + (delete-duplicate-leaves '("doc" + ("info" + "/binutils/ld.info" + "/binutils/standards.info" + "/gcc/gcc.info" + "/gcc/standards.info")) + leaf=?))) + (test-skip (if (and %store (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV))) |