1
1
mirror of https://github.com/nmattia/snack.git synced 2024-09-11 11:55:36 +03:00

Add a failing test that should pass when source-dirs is a list, #93.

This commit is contained in:
Phil de Joux 2018-11-09 12:20:53 -05:00
parent 90e27fccb0
commit 4f310e0783
7 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,7 @@
module Bar where
import Conduit
import FooBar
main :: IO ()
main = runConduit $ spitOut .| takeC 5 .| digest

View File

@ -0,0 +1,4 @@
import qualified Bar
main :: IO ()
main = Bar.main

5
tests/source-dirs/golden Normal file
View File

@ -0,0 +1,5 @@
1
2
3
4
5

View File

@ -0,0 +1,4 @@
{ main = "Foo";
src = [ ./src ./app ];
dependencies = [ "conduit" ];
}

View File

@ -0,0 +1,11 @@
name: snack-source-dirs-test
dependencies:
- base
- conduit
executable:
main: Foo.hs
source-dirs:
- src
- app

View 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
View 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