diff options
| author | Saku Laesvuori <saku@laesvuori.fi> | 2023-12-03 11:45:07 +0200 |
|---|---|---|
| committer | Lars-Dominik Braun <lars@6xq.net> | 2023-12-03 16:15:29 +0100 |
| commit | ab8612d99eca5c25ecbefe026b04ed9f00e3f8b5 (patch) | |
| tree | 5233740e9cf5f407a57542039981abb43b16bb96 /tests | |
| parent | 2c9ac9ab20c76abe570ff83f8746fa089fea3047 (diff) | |
guix: import: Fix parsing Cabal files that import many stanzas
* guix/import/cabal.scm (eval-cabal)[eval]: Split imports to a
normalized list before mapping over it.
* tests/hackage.scm: Test it.
Change-Id: I39ece019251b6a23a937c8562d2d4a545a6bc7df
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hackage.scm | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/hackage.scm b/tests/hackage.scm index 32e5f393297..403f587c41d 100644 --- a/tests/hackage.scm +++ b/tests/hackage.scm | |||
| @@ -622,4 +622,49 @@ executable cabal | |||
| 622 | (test-assert "hackage->guix-package test cabal import" | 622 | (test-assert "hackage->guix-package test cabal import" |
| 623 | (eval-test-with-cabal test-cabal-import match-ghc-foo-import)) | 623 | (eval-test-with-cabal test-cabal-import match-ghc-foo-import)) |
| 624 | 624 | ||
| 625 | (define test-cabal-multiple-imports | ||
| 626 | "name: foo | ||
| 627 | version: 1.0.0 | ||
| 628 | homepage: http://test.org | ||
| 629 | synopsis: synopsis | ||
| 630 | description: description | ||
| 631 | license: BSD3 | ||
| 632 | common commons | ||
| 633 | build-depends: | ||
| 634 | HTTP >= 4000.2.5 && < 4000.3, | ||
| 635 | mtl >= 2.0 && < 3 | ||
| 636 | |||
| 637 | common others | ||
| 638 | build-depends: | ||
| 639 | base == 4.16.*, | ||
| 640 | stm-chans == 3.0.* | ||
| 641 | |||
| 642 | executable cabal | ||
| 643 | import: | ||
| 644 | commons | ||
| 645 | , others | ||
| 646 | ") | ||
| 647 | |||
| 648 | (define-package-matcher match-ghc-foo-multiple-imports | ||
| 649 | ('package | ||
| 650 | ('name "ghc-foo") | ||
| 651 | ('version "1.0.0") | ||
| 652 | ('source | ||
| 653 | ('origin | ||
| 654 | ('method 'url-fetch) | ||
| 655 | ('uri ('hackage-uri "foo" 'version)) | ||
| 656 | ('sha256 | ||
| 657 | ('base32 | ||
| 658 | (? string? hash))))) | ||
| 659 | ('build-system 'haskell-build-system) | ||
| 660 | ('properties '(quote ((upstream-name . "foo")))) | ||
| 661 | ('inputs ('list 'ghc-http 'ghc-stm-chans)) | ||
| 662 | ('home-page "http://test.org") | ||
| 663 | ('synopsis (? string?)) | ||
| 664 | ('description (? string?)) | ||
| 665 | ('license 'license:bsd-3))) | ||
| 666 | |||
| 667 | (test-assert "hackage->guix-package test cabal multiple imports" | ||
| 668 | (eval-test-with-cabal test-cabal-multiple-imports match-ghc-foo-multiple-imports)) | ||
| 669 | |||
| 625 | (test-end "hackage") | 670 | (test-end "hackage") |
