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

Test that utf-8 files can be parsed

This commit is contained in:
Nicolas Mattia 2018-08-26 19:28:52 +03:00
parent cfb981c4e1
commit abd187035c
5 changed files with 40 additions and 0 deletions

12
tests/utf-8/Main.hs Normal file
View File

@ -0,0 +1,12 @@
{-|
Copyright:
© 2018 Nicolas Mattia
-}
module Main
( main
) where
import Numeric.Natural (Natural)
main :: IO ()
main = putStrLn "hello"

1
tests/utf-8/golden Normal file
View File

@ -0,0 +1 @@
hello

4
tests/utf-8/package.yaml Normal file
View File

@ -0,0 +1,4 @@
name: snack-strips-versions
executable:
main: Main.hs
source-dirs: .

3
tests/utf-8/snack.nix Normal file
View File

@ -0,0 +1,3 @@
{ main = "Main";
src = ./.;
}

20
tests/utf-8/test Executable file
View File

@ -0,0 +1,20 @@
#!/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" test
SNACK="snack -s ./snack.nix" test
SNACK="snack --package-yaml ./package.yaml" test