mirror of
https://github.com/nmattia/snack.git
synced 2025-01-06 04:25:30 +03:00
Add a failing test that should pass when source-dirs is a list, #93.
This commit is contained in:
parent
90e27fccb0
commit
4f310e0783
7
tests/source-dirs/app/Bar.hs
Normal file
7
tests/source-dirs/app/Bar.hs
Normal file
@ -0,0 +1,7 @@
|
||||
module Bar where
|
||||
|
||||
import Conduit
|
||||
import FooBar
|
||||
|
||||
main :: IO ()
|
||||
main = runConduit $ spitOut .| takeC 5 .| digest
|
4
tests/source-dirs/app/Foo.hs
Normal file
4
tests/source-dirs/app/Foo.hs
Normal file
@ -0,0 +1,4 @@
|
||||
import qualified Bar
|
||||
|
||||
main :: IO ()
|
||||
main = Bar.main
|
5
tests/source-dirs/golden
Normal file
5
tests/source-dirs/golden
Normal file
@ -0,0 +1,5 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
4
tests/source-dirs/package.nix
Normal file
4
tests/source-dirs/package.nix
Normal file
@ -0,0 +1,4 @@
|
||||
{ main = "Foo";
|
||||
src = [ ./src ./app ];
|
||||
dependencies = [ "conduit" ];
|
||||
}
|
11
tests/source-dirs/package.yaml
Normal file
11
tests/source-dirs/package.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
name: snack-source-dirs-test
|
||||
|
||||
dependencies:
|
||||
- base
|
||||
- conduit
|
||||
|
||||
executable:
|
||||
main: Foo.hs
|
||||
source-dirs:
|
||||
- src
|
||||
- app
|
9
tests/source-dirs/src/FooBar.hs
Normal file
9
tests/source-dirs/src/FooBar.hs
Normal file
@ -0,0 +1,9 @@
|
||||
module FooBar where
|
||||
|
||||
import Conduit
|
||||
|
||||
spitOut :: ConduitT () Int IO ()
|
||||
spitOut = yieldMany [ 1 ..]
|
||||
|
||||
digest :: ConduitT Int Void IO ()
|
||||
digest = mapM_C print
|
25
tests/source-dirs/test
Executable file
25
tests/source-dirs/test
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# vim: ft=sh sw=2 et
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
test() {
|
||||
$SNACK build
|
||||
$SNACK run | diff golden -
|
||||
|
||||
TMP_FILE=$(mktemp)
|
||||
|
||||
capture_io "$TMP_FILE" main | $SNACK ghci
|
||||
|
||||
diff golden $TMP_FILE
|
||||
rm $TMP_FILE
|
||||
}
|
||||
|
||||
|
||||
SNACK="snack -j4" test
|
||||
|
||||
# TODO: Fix cannot coerce a list to a string, at /...-snack-lib/files.nix:66:12
|
||||
SNACK="snack -j4 -s ./package.nix" test
|
||||
|
||||
# TODO: Fix cannot coerce a list to a string, at /...-snack-lib/hpack.nix:60:37
|
||||
SNACK="snack -j4 --package-yaml ./package.yaml" test
|
Loading…
Reference in New Issue
Block a user