me
/
guix
Archived
1
0
Fork 0

gexp: Make sure 'gexp-outputs' removes duplicate outputs.

Fixes a regression introduced in f9efe56.

* guix/gexp.scm (gexp-outputs): Add call to 'delete-duplicates'.
* tests/gexp.scm ("output list, combined gexps, duplicate output"): New
  test.
master
Ludovic Courtès 2015-03-02 16:26:13 +01:00
parent 3820d39739
commit 7e75a6739b
2 changed files with 9 additions and 1 deletions

View File

@ -319,7 +319,8 @@ references."
(_
result)))
(add-reference-output (gexp-references exp) '()))
(delete-duplicates
(add-reference-output (gexp-references exp) '())))
(define* (gexp->sexp exp #:key
(system (%current-system))

View File

@ -230,6 +230,13 @@
(gexp-outputs exp2))
(= 2 (length (gexp-outputs exp2))))))
(test-equal "output list, combined gexps, duplicate output"
1
(let* ((exp0 (gexp (mkdir (ungexp output))))
(exp1 (gexp (begin (mkdir (ungexp output)) (ungexp exp0))))
(exp2 (gexp (begin (mkdir (ungexp output)) (ungexp exp1)))))
(length (gexp-outputs exp2))))
(test-assert "output list + ungexp-splicing list, combined gexps"
(let* ((exp0 (gexp (mkdir (ungexp output))))
(exp1 (gexp (mkdir (ungexp output "foo"))))