Skip to content

Commit 1994bd3

Browse files
author
Tom Sydney Kerckhove
committed
Integration test for the bug from issue 4453
1 parent 38ee7fe commit 1994bd3

File tree

7 files changed

+89
-0
lines changed

7 files changed

+89
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import StackTest
2+
import System.Directory
3+
4+
main :: IO ()
5+
main = do
6+
removeDirIgnore ".stack-work"
7+
stack ["test"]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cabal-sandbox/
2+
cabal.sandbox.config
3+
.stack-work/
4+
dist/
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright Axel Mannhardt (c) 2015
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of Author name here nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Lib
2+
( someFunc
3+
) where
4+
5+
someFunc :: IO ()
6+
someFunc = putStrLn "someFunc"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: lts-11.22
2+
packages:
3+
- '.'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test-detailed-example
2+
version: 0.1.0.0
3+
build-type: Simple
4+
cabal-version: >=1.20
5+
6+
library
7+
hs-source-dirs: src
8+
exposed-modules: Lib
9+
build-depends: base >= 4.7 && < 5
10+
default-language: Haskell2010
11+
12+
test-suite test-detailed-example-test
13+
type: detailed-0.9
14+
hs-source-dirs: test
15+
test-module: Spec
16+
build-depends: base >= 4.7,
17+
Cabal >= 1.20
18+
default-language: Haskell2010
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module Spec (tests) where
2+
3+
import Distribution.TestSuite
4+
5+
tests :: IO [Test]
6+
tests = do
7+
return [
8+
test "foo" Pass
9+
, test "bar" (Fail "It did not work out!")
10+
]
11+
12+
test :: String -> Result -> Test
13+
test name r = Test t
14+
where
15+
t = TestInstance {
16+
run = return (Finished r)
17+
, name = name
18+
, tags = []
19+
, options = []
20+
, setOption = \_ _ -> Right t
21+
}

0 commit comments

Comments
 (0)