From 3b4d01035f214ac57ac1517b719e2b0f0f092411 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 10 Sep 2015 15:39:44 -0500 Subject: guix: packages: Add origin-actual-file-name. * guix/scripts/graph.scm (uri->file-name, node-full-name): Move origin file name logic to... * guix/packages.scm (origin-actual-file-name): ...here. * tests/packages.scm ("origin-actual-file-name") ("origin-actual-file-name, file-name"): New tests. --- tests/packages.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/packages.scm') diff --git a/tests/packages.scm b/tests/packages.scm index 00a0998b4c..ace2f36f19 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -177,6 +177,18 @@ (define read-at (package-transitive-supported-systems d) (package-transitive-supported-systems e)))) +(test-equal "origin-actual-file-name" + "foo-1.tar.gz" + (let ((o (dummy-origin (uri "http://www.example.com/foo-1.tar.gz")))) + (origin-actual-file-name o))) + +(test-equal "origin-actual-file-name, file-name" + "foo-1.tar.gz" + (let ((o (dummy-origin + (uri "http://www.example.com/tarball") + (file-name "foo-1.tar.gz")))) + (origin-actual-file-name o))) + (let* ((o (dummy-origin)) (u (dummy-origin)) (i (dummy-origin)) -- cgit v1.2.3