[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/08: import: cabal: Allow properties without space between key and val
From: |
guix-commits |
Subject: |
03/08: import: cabal: Allow properties without space between key and value. |
Date: |
Mon, 6 Jun 2022 07:29:26 -0400 (EDT) |
lbraun pushed a commit to branch master
in repository guix.
commit 001e0bac99c977d2ff04910295b154f91aa3d369
Author: Lars-Dominik Braun <lars@6xq.net>
AuthorDate: Sat Apr 30 15:39:51 2022 +0200
import: cabal: Allow properties without space between key and value.
* guix/import/cabal.scm (lex-word): Add colon to delimiters.
* tests/hackage.scm (test-cabal-property-no-space): New variable.
("hackage->guix-package test properties without space"): New test.
---
guix/import/cabal.scm | 2 +-
tests/hackage.scm | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm
index 364fcc3176..9f3862fa14 100644
--- a/guix/import/cabal.scm
+++ b/guix/import/cabal.scm
@@ -573,7 +573,7 @@ location."
(define (lex-word port loc)
"Process tokens which can be recognized by reading the next word form PORT.
LOC is the current port location."
- (let* ((w (read-delimited " <>=()\t\n" port 'peek)))
+ (let* ((w (read-delimited " <>=():\t\n" port 'peek)))
(cond ((is-if w) (lex-if loc))
((is-elif w) (lex-elif loc))
((is-test w port) (lex-test w loc))
diff --git a/tests/hackage.scm b/tests/hackage.scm
index 15309a3381..4ce48b6baf 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -315,6 +315,25 @@ executable cabal
(test-assert "hackage->guix-package test flag executable"
(eval-test-with-cabal test-cabal-flag-executable match-ghc-foo))
+;; There is no mandatory space between property name and value.
+(define test-cabal-property-no-space
+ "name:foo
+version:1.0.0
+homepage:http://test.org
+synopsis:synopsis
+description:description
+license:BSD3
+common bench-defaults
+ ghc-options:-Wall
+executable cabal
+ build-depends:
+ HTTP >= 4000.2.5 && < 4000.3,
+ mtl >= 2.0 && < 3
+")
+
+(test-assert "hackage->guix-package test properties without space"
+ (eval-test-with-cabal test-cabal-property-no-space match-ghc-foo))
+
;; Check if-elif-else statements
(define test-cabal-if
"name: foo
- branch master updated (0c6123f8aa -> 143141726e), guix-commits, 2022/06/06
- 03/08: import: cabal: Allow properties without space between key and value.,
guix-commits <=
- 04/08: import: cabal: Allow curly bracket before else statement., guix-commits, 2022/06/06
- 06/08: import: cabal: Support library names, guix-commits, 2022/06/06
- 02/08: import: cabal: Allow curly brackets in more positions., guix-commits, 2022/06/06
- 01/08: import: cabal: Support elif statement., guix-commits, 2022/06/06
- 05/08: import: cabal: Document failing syntax through tests., guix-commits, 2022/06/06
- 07/08: import: hackage: Filter internal libraries from inputs and native-inputs., guix-commits, 2022/06/06
- 08/08: import: hackage: Filter upper/mixed case dependencies too., guix-commits, 2022/06/06