mirror of
https://github.com/nmattia/snack.git
synced 2025-01-07 13:47:09 +03:00
commit
4df17e3efa
@ -20,6 +20,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
||||
|
||||
### Fixed
|
||||
- The module import parsing when the CPP extension is enabled.
|
||||
- The module import parsing when a BOM is present
|
||||
- The module import parsing when a BOM is present.
|
||||
- The matching on Haskell files. Any file in any subdirectory ending in `.hs` will be matched, both lower- and uppercase filenames are accepted.
|
||||
|
||||
[Unreleased]: https://github.com/nmattia/snack/compare/51987daf76cffc31289e6913174dfb46b93df36b...HEAD
|
||||
|
@ -39,7 +39,7 @@ rec {
|
||||
# Whether the file is a Haskell module or not. It uses very simple
|
||||
# heuristics: If the file starts with a capital letter, then yes.
|
||||
isHaskellModuleFile = f:
|
||||
! (builtins.isNull (builtins.match "[A-Z].*" f));
|
||||
! (builtins.isNull (builtins.match "[a-zA-Z].*[.]hs$" (builtins.baseNameOf f)));
|
||||
|
||||
listModulesInDir = dir:
|
||||
map fileToModule
|
||||
|
3
tests/swp/golden.jq
Normal file
3
tests/swp/golden.jq
Normal file
@ -0,0 +1,3 @@
|
||||
[
|
||||
"Foo.Bar"
|
||||
]
|
3
tests/swp/package.nix
Normal file
3
tests/swp/package.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{ src = ./src;
|
||||
dependencies = [ "conduit" ];
|
||||
}
|
BIN
tests/swp/src/Foo/.Bar.hs.swp
Normal file
BIN
tests/swp/src/Foo/.Bar.hs.swp
Normal file
Binary file not shown.
9
tests/swp/src/Foo/Bar.hs
Normal file
9
tests/swp/src/Foo/Bar.hs
Normal file
@ -0,0 +1,9 @@
|
||||
module Bar where
|
||||
|
||||
import Conduit
|
||||
|
||||
spitOut :: ConduitT () Int IO ()
|
||||
spitOut = yieldMany [ 1 ..]
|
||||
|
||||
digest :: ConduitT Int Void IO ()
|
||||
digest = mapM_C print
|
14
tests/swp/test
Executable file
14
tests/swp/test
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# vim: ft=sh sw=2 et
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
test() {
|
||||
TMP_FILE=$(mktemp)
|
||||
|
||||
cat $($SNACK build) | jq -M '.result | keys' > $TMP_FILE
|
||||
|
||||
diff golden.jq $TMP_FILE
|
||||
}
|
||||
|
||||
SNACK="snack -j4" test
|
Loading…
Reference in New Issue
Block a user