[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: tests: opam: Test additional syntax.
From: |
guix-commits |
Subject: |
03/03: tests: opam: Test additional syntax. |
Date: |
Thu, 1 Oct 2020 18:51:15 -0400 (EDT) |
roptat pushed a commit to branch master
in repository guix.
commit 23dc21f05b54ef63daaea9eb301cfddbc4c82ddb
Author: Julien Lepiller <julien@lepiller.eu>
AuthorDate: Fri Oct 2 00:28:30 2020 +0200
tests: opam: Test additional syntax.
* tests/opam.scm (test-comment): New test.
(test-lists): Add more tests for complex list patterns.
---
tests/opam.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/opam.scm b/tests/opam.scm
index ef61fbb..ec2a668 100644
--- a/tests/opam.scm
+++ b/tests/opam.scm
@@ -152,7 +152,11 @@ url {
("[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 @@ url {
("{ = \"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")