1
1
mirror of https://github.com/nmattia/snack.git synced 2024-11-28 03:45:45 +03:00

Add test for extension enabling in parser

This commit is contained in:
Nicolas Mattia 2018-10-21 18:28:06 +02:00
parent 4df17e3efa
commit 3f94647bd4
4 changed files with 30 additions and 0 deletions

7
tests/cpp-2/Main.hs Normal file
View File

@ -0,0 +1,7 @@
module Main where
main :: IO ()
main = putStrLn "hello"
foo :: forall a. a -> a
foo = id

1
tests/cpp-2/golden Normal file
View File

@ -0,0 +1 @@
hello

4
tests/cpp-2/package.nix Normal file
View File

@ -0,0 +1,4 @@
{ main = "Main";
src = ./.;
extensions = ["RankNTypes" "CPP"];
}

18
tests/cpp-2/test Executable file
View File

@ -0,0 +1,18 @@
#!/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