diff options
author | Christopher Baines <mail@cbaines.net> | 2021-04-24 06:43:46 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-05-15 12:14:47 +0100 |
commit | 97d615b1761c2054561057f6b56e2a0caed13aa4 (patch) | |
tree | a2a18b43a4038b244c594c9d599f53563727a217 /tests | |
parent | b149c16371b935795c821d3df3d90fe9f741cbd7 (diff) | |
download | guix-97d615b1761c2054561057f6b56e2a0caed13aa4.tar guix-97d615b1761c2054561057f6b56e2a0caed13aa4.tar.gz |
inferior: Support querying package replacements.
I'm looking at this to help with adding support for looking up package
replacements to store in the Guix Data Service.
* guix/inferior.scm (inferior-package-replacement): New procedure.
* tests/inferior.scm ("inferior-package-replacement"): New test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/inferior.scm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/inferior.scm b/tests/inferior.scm index f227e0b749..9992077cb2 100644 --- a/tests/inferior.scm +++ b/tests/inferior.scm @@ -26,6 +26,7 @@ #:use-module (gnu packages) #:use-module (gnu packages bootstrap) #:use-module (gnu packages guile) + #:use-module (gnu packages sqlite) #:use-module (srfi srfi-1) #:use-module (srfi srfi-34) #:use-module (srfi srfi-64) @@ -260,6 +261,25 @@ (list (inferior-package-derivation %store guile "x86_64-linux") (inferior-package-derivation %store guile "armhf-linux"))))) +(unless (package-replacement sqlite) + (test-skip 1)) + +(test-equal "inferior-package-replacement" + (package-derivation %store + (package-replacement sqlite) + "x86_64-linux") + (let* ((inferior (open-inferior %top-builddir + #:command "scripts/guix")) + (packages (inferior-packages inferior))) + (match (lookup-inferior-packages inferior + (package-name sqlite) + (package-version sqlite)) + ((inferior-sqlite rest ...) + (inferior-package-derivation %store + (inferior-package-replacement + inferior-sqlite) + "x86_64-linux"))))) + (test-equal "inferior-package->manifest-entry" (manifest-entry->list (package->manifest-entry (first (find-best-packages-by-name "guile" #f)))) |