mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
import: cabal: Allow curly brackets in more positions.
* guix/import/cabal.scm (is-layout-property): Do not expect end of line. (lex-layout-property): Check for newline. (lex-property): Stop reading on closing curly bracket. * tests/hackage.scm (test-read-cabal-2): New variable. ("read-cabal test: if brackets on the same line"): New test.
This commit is contained in:
parent
2c5d18e421
commit
0972feaff1
2 changed files with 24 additions and 3 deletions
|
@ -156,6 +156,12 @@ library
|
|||
Exposed-Modules:
|
||||
Test.QuickCheck.Exception")
|
||||
|
||||
(define test-read-cabal-2
|
||||
"name: test-me
|
||||
common defaults
|
||||
if os(foobar) { cc-options: -DBARBAZ }
|
||||
") ; Intentional newline.
|
||||
|
||||
(test-begin "hackage")
|
||||
|
||||
(define-syntax-rule (define-package-matcher name pattern)
|
||||
|
@ -471,6 +477,16 @@ executable cabal
|
|||
#t)
|
||||
(x (pk 'fail x #f))))
|
||||
|
||||
(test-assert "read-cabal test: if brackets on the same line"
|
||||
(match (call-with-input-string test-read-cabal-2 read-cabal)
|
||||
((("name" ("test-me"))
|
||||
('section 'common "defaults"
|
||||
(('if ('os "foobar")
|
||||
(("cc-options" ("-DBARBAZ ")))
|
||||
()))))
|
||||
#t)
|
||||
(x (pk 'fail x #f))))
|
||||
|
||||
(define test-cabal-import
|
||||
"name: foo
|
||||
version: 1.0.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue