mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
tests: opam: Test additional syntax.
* tests/opam.scm (test-comment): New test. (test-lists): Add more tests for complex list patterns.
This commit is contained in:
parent
a6816618fc
commit
23dc21f05b
1 changed files with 10 additions and 1 deletions
|
@ -152,7 +152,11 @@ (define (test-opam-syntax name pattern test-cases)
|
|||
("[make]" . (list-pat (var "make")))
|
||||
("[\"make\"]" . (list-pat (string-pat "make")))
|
||||
("[\n a\n b\n c]" . (list-pat (var "a") (var "b") (var "c")))
|
||||
("[a b \"c\"]" . (list-pat (var "a") (var "b") (string-pat "c")))))
|
||||
("[a b \"c\"]" . (list-pat (var "a") (var "b") (string-pat "c")))
|
||||
;; complex lists
|
||||
("[(a & b)]" . (list-pat (choice-pat (group-pat (var "a") (var "b")))))
|
||||
("[(a | b & c)]" . (list-pat (choice-pat (var "a") (group-pat (var "b") (var "c")))))
|
||||
("[a (b | c) d]" . (list-pat (var "a") (choice-pat (var "b") (var "c")) (var "d")))))
|
||||
|
||||
(test-opam-syntax
|
||||
"parse-dicts" dict
|
||||
|
@ -179,4 +183,9 @@ (define (test-opam-syntax name pattern test-cases)
|
|||
("{ = \"1.0+beta19\" }" . (condition-eq
|
||||
(condition-string "1.0+beta19")))))
|
||||
|
||||
(test-opam-syntax
|
||||
"parse-comment" list-pat
|
||||
'(("" . #f)
|
||||
("[#comment\n]" . list-pat)))
|
||||
|
||||
(test-end "opam")
|
||||
|
|
Loading…
Reference in a new issue