summary refs log tree commit diff
path: root/tests/union.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/union.scm')
-rw-r--r--tests/union.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/union.scm b/tests/union.scm
index 58c0a301b2..5bbf992a59 100644
--- a/tests/union.scm
+++ b/tests/union.scm
@@ -65,6 +65,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)))