summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorSaku Laesvuori <saku@laesvuori.fi>2023-12-02 19:23:06 +0200
committerLars-Dominik Braun <lars@6xq.net>2023-12-03 09:11:29 +0100
commit5bd00bb54235856dddd11e9f0d03481c5469ca63 (patch)
treea69e16fdb246bca13f66a741e39189a1f015409a /tests
parentacef524961d4da3464dbc392699fbe7deb0a467b (diff)
downloadguix-5bd00bb54235856dddd11e9f0d03481c5469ca63.tar.gz
guix: import: Parse cabal layout blocks correctly
Cabal consideres lines to be part of a layout block if they are indented
at least one space more than the field line the block belongs to.
Previously Guix considered lines to be a part of the block if they were
indented at least as much as the first line in it.

This also makes a workaround that enabled if statements to have multiple
elses redundant and removes it.

Fixes: https://issues.guix.gnu.org/35743

* guix/import/cabal.scm (current-indentation*): Renamed from
current-indentation.
(previous-indentation, current-indentation): New variables.
(make-cabal-parser): Remove outdated comment.
[open]: Use previous-indentation + 1 instead of
current-indentation.
[elif-else]: Split to elif and else to allow only one ELSE in an if
statement.
(read-cabal)[parameterize]: Use current-indentation* and previous-indentation.
* tests/hackage.scm (hackage->guix-package test mixed layout): Expect to
  pass.

Change-Id: I3a1495b1588a022fabbfe8dad9f3231e578af4f3
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/hackage.scm2
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/hackage.scm b/tests/hackage.scm
index 8eea818ebd..32e5f39329 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -306,8 +306,6 @@ executable cabal
   ghc-options: -Wall
 ")
 
-;; Fails: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35743
-(test-expect-fail 1)
 (test-assert "hackage->guix-package test mixed layout"
   (eval-test-with-cabal test-cabal-mixed-layout match-ghc-foo))