Skip to content

Commit c032c48

Browse files
committed
Add test
1 parent c536fbe commit c032c48

File tree

7 files changed

+53
-0
lines changed

7 files changed

+53
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Foo where
2+
3+
a :: Int
4+
a = 42
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal clean
2+
# cabal repl
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal clean
2+
# cabal repl
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal clean
2+
# cabal repl
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: .
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import Test.Cabal.Prelude
2+
3+
-- Test “repl --build-depends”
4+
main = do
5+
let imports = "import qualified Data.ByteString as BS"
6+
cabalTest' "normal" $ do
7+
cabal' "clean" []
8+
res <- cabalWithStdin
9+
"repl"
10+
["-v2", "--build-depends", "bytestring"]
11+
imports
12+
assertOutputContains "Ok, one module loaded." res
13+
-- Ensure we can load ‘bytestring’
14+
assertOutputDoesNotContain "Could not load" res
15+
cabalTest' "allow-newer" $ do
16+
cabal' "clean" []
17+
res <- cabalWithStdin
18+
"repl"
19+
["-v2", "--build-depends", "bytestring", "--allow-newer"]
20+
imports
21+
assertOutputContains "Ok, one module loaded." res
22+
-- Ensure we can load ‘bytestring’
23+
-- See https://github.com/haskell/cabal/issues/6859
24+
assertOutputDoesNotContain "Could not load" res
25+
cabalTest' "allow-older" $ do
26+
cabal' "clean" []
27+
res <- cabalWithStdin
28+
"repl"
29+
["-v2", "--build-depends", "bytestring", "--allow-older"]
30+
imports
31+
assertOutputContains "Ok, one module loaded." res
32+
-- Ensure we can load ‘bytestring’
33+
-- See https://github.com/haskell/cabal/issues/6859
34+
assertOutputDoesNotContain "Could not load" res
35+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cabal-version: 2.4
2+
name: pkg
3+
version: 0.1.0.0
4+
library
5+
exposed-modules: Foo
6+
build-depends: base
7+
default-language: Haskell2010

0 commit comments

Comments
 (0)