1 import Test
.Cabal
.Prelude
4 cabalTest
' "single-repl-options" $ do
6 res
<- cabalWithStdin
"v2-repl" ["--repl-options=-fwrite-interface"] ":set"
7 assertOutputContains
"Ok, two modules loaded." res
8 assertOutputContains
" -fwrite-interface" res
9 cabalTest
' "multiple-repl-options" $ do
11 res
<- cabalWithStdin
"v2-repl" ["--repl-options=-fwrite-interface", "--repl-options=-fdefer-typed-holes"] ":set"
12 assertOutputContains
"Ok, two modules loaded." res
13 assertOutputContains
" -fwrite-interface" res
14 assertOutputContains
" -fdefer-typed-holes" res
15 cabalTest
' "single-repl-options-multiple-flags" $ do
17 res
<- cabalWithStdin
"v2-repl" ["--repl-options=-fdefer-typed-holes -fwrite-interface"] ":set"
18 assertOutputContains
"Ok, two modules loaded." res
19 assertOutputContains
" -fwrite-interface" res
20 assertOutputContains
" -fdefer-typed-holes" res
21 cabalTest
' "single-repl-options-multiple-flags-negative" $ do
23 res
<- fails
$ cabalWithStdin
"v2-repl" ["--repl-options=-fwrite-interface -fdiagnostics-show-baret"] ":set"
24 assertOutputDoesNotContain
"Ok, two modules loaded." res
25 assertOutputContains
"unrecognised flag: -fdiagnostics-show-baret" res
26 assertOutputContains
"did you mean one of:" res
27 cabalTest
' "multiple-repl-options-multiple-flags" $ do
29 res
<- cabalWithStdin
"v2-repl" [
30 "--repl-options=-fforce-recomp -fwrite-interface",
31 "--repl-options=-fdefer-type-errors -fdefer-typed-holes"
33 assertOutputContains
"Ok, two modules loaded." res
34 assertOutputContains
" -fwrite-interface" res
35 assertOutputContains
" -fforce-recomp" res
36 assertOutputContains
" -fdefer-typed-holes" res
37 assertOutputContains
" -fdefer-type-errors" res