[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#35929] [PATCH] tests: hackage: avoid mock, and extract test data
From: |
Robert Vollmert |
Subject: |
[bug#35929] [PATCH] tests: hackage: avoid mock, and extract test data |
Date: |
Wed, 29 May 2019 23:25:27 +0200 |
> On 29. May 2019, at 23:16, Ludovic Courtès <address@hidden> wrote:
> Robert Vollmert <address@hidden> skribis:
>
>> +(define* (eval-test-with-cabal test-cabal package-pattern #:key
>> (cabal-environment '()))
>> + (define port (open-input-string test-cabal))
>> + (match (hackage->guix-package "foo" #:port port #:cabal-environment
>> cabal-environment)
>> + (package-pattern #t)
>
> This pattern matches anything and binds the result to ‘package-pattern’:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> (let ((pattern '(a b)))
> (match '(1 2 3) (pattern pattern)))
> $9 = (1 2 3)
> --8<---------------cut here---------------end--------------->8---
>
> No more test failures! :-)
>
> The change you propose is a good idea but it needs to be implemented
> using a macro:
Thanks, I’ll look into it. My first macro. :)