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:
parent
4df17e3efa
commit
3f94647bd4
7
tests/cpp-2/Main.hs
Normal file
7
tests/cpp-2/Main.hs
Normal 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
1
tests/cpp-2/golden
Normal file
@ -0,0 +1 @@
|
||||
hello
|
4
tests/cpp-2/package.nix
Normal file
4
tests/cpp-2/package.nix
Normal file
@ -0,0 +1,4 @@
|
||||
{ main = "Main";
|
||||
src = ./.;
|
||||
extensions = ["RankNTypes" "CPP"];
|
||||
}
|
18
tests/cpp-2/test
Executable file
18
tests/cpp-2/test
Executable 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
|
Loading…
Reference in New Issue
Block a user