mirror of
https://github.com/nmattia/snack.git
synced 2025-01-06 04:25:30 +03:00
Test that utf-8 files can be parsed
This commit is contained in:
parent
cfb981c4e1
commit
abd187035c
12
tests/utf-8/Main.hs
Normal file
12
tests/utf-8/Main.hs
Normal 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
1
tests/utf-8/golden
Normal file
@ -0,0 +1 @@
|
||||
hello
|
4
tests/utf-8/package.yaml
Normal file
4
tests/utf-8/package.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
name: snack-strips-versions
|
||||
executable:
|
||||
main: Main.hs
|
||||
source-dirs: .
|
3
tests/utf-8/snack.nix
Normal file
3
tests/utf-8/snack.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{ main = "Main";
|
||||
src = ./.;
|
||||
}
|
20
tests/utf-8/test
Executable file
20
tests/utf-8/test
Executable 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
|
Loading…
Reference in New Issue
Block a user