diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-03-04 14:07:23 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-03-04 14:07:23 +0100 |
commit | 1289062522e3d08259740e59243c6cd0642a9916 (patch) | |
tree | 65857ae41001e3b33db621073cf1504de601dda1 /tests | |
parent | cb4d3d863b3fb44d97b3b568ff9e6cfe38f1f630 (diff) | |
parent | da699774d4d839a45daa3ae3b9189331c490b315 (diff) | |
download | guix-1289062522e3d08259740e59243c6cd0642a9916.tar guix-1289062522e3d08259740e59243c6cd0642a9916.tar.gz |
Merge branch 'core-updates'.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gexp.scm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 0b189b570b..783ca2cdbc 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -42,6 +42,7 @@ ;; For white-box testing. (define gexp-inputs (@@ (guix gexp) gexp-inputs)) (define gexp-native-inputs (@@ (guix gexp) gexp-native-inputs)) +(define gexp-outputs (@@ (guix gexp) gexp-outputs)) (define gexp->sexp (@@ (guix gexp) gexp->sexp)) (define* (gexp->sexp* exp #:optional target) @@ -214,6 +215,38 @@ (equal? (gexp->sexp* exp) ;native (gexp->sexp* exp "mips64el-linux"))))) +(test-equal "output list" + 2 + (let ((exp (gexp (begin (mkdir (ungexp output)) + (mkdir (ungexp output "bar")))))) + (length (gexp-outputs exp)))) ;XXX: <output-ref> is private + +(test-assert "output list, combined gexps" + (let* ((exp0 (gexp (mkdir (ungexp output)))) + (exp1 (gexp (mkdir (ungexp output "foo")))) + (exp2 (gexp (begin (display "hi!") (ungexp exp0) (ungexp exp1))))) + (and (lset= equal? + (append (gexp-outputs exp0) (gexp-outputs exp1)) + (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")))) + (exp2 (gexp (begin (display "hi!") + (ungexp-splicing (list exp0 exp1)))))) + (and (lset= equal? + (append (gexp-outputs exp0) (gexp-outputs exp1)) + (gexp-outputs exp2)) + (= 2 (length (gexp-outputs exp2)))))) + (test-assertm "gexp->file" (mlet* %store-monad ((exp -> (gexp (display (ungexp %bootstrap-guile)))) (guile (package-file %bootstrap-guile)) |