mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
import: hackage: Parse braced properties.
This adds partial support for Cabal properties that use curly braces instead of the layout rule. See for example https://hackage.haskell.org/package/cassava/ * guix/import/cabal.scm (read-braced-value): New procedure. (is-property): Remove. (is-layout-property, is-braced-property): New variables. (lex-property): Rename to... (lex-layout-property): ... this. (lex-braced-property, lex-property): New procedures. (lex-token): Add call to 'lex-property'. * guix/tests/hackage.scm: Test braced description import. * tests/hackage.scm (test-cabal-multiline-desc): Rename to... (test-cabal-multiline-layout): ... this. ("hackage->guix-package test multiline desc"): Rename to... ("hackage->guix-package test multiline desc (layout)"): ... this. (test-cabal-multiline-braced): New variable. ("hackage->guix-package test multiline desc (braced)"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
64d3181357
commit
959c9d159d
2 changed files with 50 additions and 10 deletions
|
@ -237,7 +237,7 @@ library
|
|||
(eval-test-with-cabal test-cabal-6 match-ghc-foo-6))
|
||||
|
||||
;; Check multi-line layouted description
|
||||
(define test-cabal-multiline-desc
|
||||
(define test-cabal-multiline-layout
|
||||
"name: foo
|
||||
version: 1.0.0
|
||||
homepage: http://test.org
|
||||
|
@ -251,9 +251,28 @@ executable cabal
|
|||
mtl >= 2.0 && < 3
|
||||
")
|
||||
|
||||
(test-assert "hackage->guix-package test multiline desc"
|
||||
(eval-test-with-cabal test-cabal-multiline-desc match-ghc-foo))
|
||||
(test-assert "hackage->guix-package test multiline desc (layout)"
|
||||
(eval-test-with-cabal test-cabal-multiline-layout match-ghc-foo))
|
||||
|
||||
;; Check multi-line braced description
|
||||
(define test-cabal-multiline-braced
|
||||
"name: foo
|
||||
version: 1.0.0
|
||||
homepage: http://test.org
|
||||
synopsis: synopsis
|
||||
description: {
|
||||
first line
|
||||
second line
|
||||
}
|
||||
license: BSD3
|
||||
executable cabal
|
||||
build-depends:
|
||||
HTTP >= 4000.2.5 && < 4000.3,
|
||||
mtl >= 2.0 && < 3
|
||||
")
|
||||
|
||||
(test-assert "hackage->guix-package test multiline desc (braced)"
|
||||
(eval-test-with-cabal test-cabal-multiline-braced match-ghc-foo))
|
||||
|
||||
(test-assert "read-cabal test 1"
|
||||
(match (call-with-input-string test-read-cabal-1 read-cabal)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue