mirror of
https://github.com/srid/haskell-flake.git
synced 2024-09-11 05:55:25 +03:00
fix(cabal.project
parser): parse the packages ending with eof (#222)
This commit is contained in:
parent
dd0d3b9d51
commit
56c5550e18
@ -5,6 +5,7 @@
|
||||
- #210: Add `extraLibraries` to `settings` module.
|
||||
- #215: Improved debug logging.
|
||||
- #216: Remove `debug` option (pass `--trace-verbose` to nix instead)
|
||||
- #222: Improve `cabal.project` parser by handling files not ending with newline
|
||||
- Breaking changes
|
||||
- #221: Switch to `buildFromSdist`, to allow using non-standard package sets (wherein `cabal-install` is otherwise built without using user's overrides)
|
||||
|
||||
|
@ -25,7 +25,11 @@ in
|
||||
key = parsec.string "packages:\n";
|
||||
val =
|
||||
parsec.many1
|
||||
(parsec.between spaces1 newline path);
|
||||
(parsec.choice
|
||||
[
|
||||
(parsec.between spaces1 newline path)
|
||||
(parsec.between spaces1 parsec.eof path)
|
||||
]);
|
||||
parser = parsec.skipThen
|
||||
key
|
||||
val;
|
||||
|
@ -17,6 +17,15 @@ let
|
||||
'';
|
||||
expected = [ "foo" "bar" ];
|
||||
};
|
||||
|
||||
# Handles cases where cabal.project does not end with newline
|
||||
testEOF = {
|
||||
expr = eval ''
|
||||
packages:
|
||||
foo
|
||||
bar'';
|
||||
expected = [ "foo" "bar" ];
|
||||
};
|
||||
};
|
||||
cabalExecutableTests =
|
||||
let
|
||||
|
Loading…
Reference in New Issue
Block a user