aboutsummaryrefslogtreecommitdiff
path: root/tests/union.scm
diff options
context:
space:
mode:
authorW. Kosior <koszko@koszko.org>2024-07-13 12:03:21 +0200
committerW. Kosior <koszko@koszko.org>2024-09-04 21:02:09 +0200
commitaa171ffcd40aee830e06b045c44b2ed51f413f95 (patch)
tree286fdece1756833af605c2c523f0fe34becb362b /tests/union.scm
parent9601961618687e78c91992b7a54d67853132f516 (diff)
downloadguix-aa171ffcd40aee830e06b045c44b2ed51f413f95.tar.gz
guix-aa171ffcd40aee830e06b045c44b2ed51f413f95.zip
gnu: Add python-django-timezone-field.
* gnu/packages/django.scm (python-django-timezone-field): New variable. Change-Id: I3f500a7a088f0311df4962391bdc692d710176e4
Diffstat (limited to 'tests/union.scm')
0 files changed, 0 insertions, 0 deletions
(uri "https://example.org/foo-1.0.0.tar.gz") (sha256 (base32 ,(? string? hash))))) (build-system ocaml-build-system) (propagated-inputs (list ocaml-zarith)) (native-inputs (list ocaml-alcotest ocamlbuild)) (home-page "https://example.org/") (synopsis "Some example package") (description "This package is just an example.") (license license:bsd-3)) (string=? (bytevector->nix-base32-string test-source-hash) hash)) (x (pk 'fail x #f)))))) ;; Test the opam file parser ;; We fold over some test cases. Each case is a pair of the string to parse and the ;; expected result. (define (test-opam-syntax name pattern test-cases) (test-assert name (fold (lambda (test acc) (display test) (newline) (match test ((str . expected) (and acc (let ((result (peg:tree (match-pattern pattern str)))) (if (equal? result expected) #t (pk 'fail (list str result expected) #f))))))) #t test-cases))) (test-opam-syntax "parse-strings" string-pat '(("" . #f) ("\"hello\"" . (string-pat "hello")) ("\"hello world\"" . (string-pat "hello world")) ("\"The dreaded \\\"é\\\"\"" . (string-pat "The dreaded \"é\"")) ("\"Have some \\\\\\\\ :)\"" . (string-pat "Have some \\\\ :)")) ("\"今日は\"" . (string-pat "今日は")))) (test-opam-syntax "parse-multiline-strings" multiline-string '(("" . #f) ("\"\"\"hello\"\"\"" . (multiline-string "hello")) ("\"\"\"hello \"world\"!\"\"\"" . (multiline-string "hello \"world\"!")) ("\"\"\"hello \"\"world\"\"!\"\"\"" . (multiline-string "hello \"\"world\"\"!")))) (test-opam-syntax "parse-lists" list-pat '(("" . #f) ("[]" . list-pat) ("[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"))) ;; 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 '(("" . #f) ("{}" . dict) ("{a: \"b\"}" . (dict (record "a" (string-pat "b")))) ("{a: \"b\"\nc: \"d\"}" . (dict (record "a" (string-pat "b")) (record "c" (string-pat "d")))))) (test-opam-syntax "parse-conditions" condition '(("" . #f) ("{}" . #f) ("{build}" . (condition-var "build")) ("{>= \"0.2.0\"}" . (condition-greater-or-equal (condition-string "0.2.0"))) ("{>= \"0.2.0\" & test}" . (condition-and (condition-greater-or-equal (condition-string "0.2.0")) (condition-var "test"))) ("{>= \"0.2.0\" | build}" . (condition-or (condition-greater-or-equal (condition-string "0.2.0")) (condition-var "build"))) ("{ = \"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")