From 533d1768f47520ac7010adc550b0dd9783ebb011 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 17 Mar 2015 10:19:36 -0400 Subject: store: Add query-path-info operation. * guix/store.scm (): New record type. (read-path-info): New procedure. (read-arg): Add 'path-info' syntax. (query-path-info): New variable. * tests/store.scm ("query-path-info"): New test. --- tests/store.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/store.scm b/tests/store.scm index f778c2086d..eeceed45c1 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -606,6 +606,16 @@ (file (add %store "foo" "Lowered."))) (call-with-input-file file get-string-all))) +(test-assert "query-path-info" + (let* ((ref (add-text-to-store %store "ref" "foo")) + (item (add-text-to-store %store "item" "bar" (list ref))) + (info (query-path-info %store item))) + (and (equal? (path-info-references info) (list ref)) + (equal? (path-info-hash info) + (sha256 + (string->utf8 + (call-with-output-string (cut write-file item <>)))))))) + (test-end "store") -- cgit 1.4.1