Skip to content

Commit eb9c5bd

Browse files
committed
Add tests for new tool version checking
1 parent f4a4328 commit eb9c5bd

File tree

8 files changed

+57
-0
lines changed

8 files changed

+57
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module Foo where
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Main where
2+
3+
main :: IO ()
4+
main = return ()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: build-tools-bad-version
2+
version: 0.1.0.0
3+
synopsis: Checks build-tools errors for bad version
4+
license: BSD3
5+
category: Testing
6+
build-type: Simple
7+
cabal-version: >=1.10
8+
9+
library
10+
exposed-modules: Foo
11+
build-tools: hello-world >=2
12+
-- ^ internal dependency, bad version bounds
13+
default-language: Haskell2010
14+
15+
executable hello-world
16+
main-is: Main.hs
17+
build-depends: base
18+
default-language: Haskell2010
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Test.Cabal.Prelude
2+
-- Test impossible version bound on internal build-tools deps
3+
main = setupAndCabalTest $ do
4+
assertOutputContains "impossible version range"
5+
=<< fails (setup' "configure" [])
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module Foo where
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Main where
2+
3+
main :: IO ()
4+
main = return ()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: build-tools-extra-version
2+
version: 0.1.0.0
3+
synopsis: Checks build-tools warns for extraneous version
4+
license: BSD3
5+
category: Testing
6+
build-type: Simple
7+
cabal-version: >=1.10
8+
9+
library
10+
exposed-modules: Foo
11+
build-tools: hello-world >=0
12+
-- ^ internal dependency, extraneous version
13+
default-language: Haskell2010
14+
15+
executable hello-world
16+
main-is: Main.hs
17+
build-depends: base
18+
default-language: Haskell2010
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Test.Cabal.Prelude
2+
-- Test unneed version bound on internal build-tools deps
3+
main = setupAndCabalTest $ do
4+
setup' "configure" []
5+
assertOutputContains "extraneous version range"
6+
=<< setup' "sdist" []

0 commit comments

Comments
 (0)