on master help sign in
Outline two test suites we will need
commit1941338ad0cdac24f99efb1a03e2b7659449d781 authormrkkrp <markkarpov@opmbx.org> dateMon 7 Nov 2016, 23:02 (10 years ago) parentfb92692
5 files changed+61−4
httpbin-tests/Network/HTTP/ReqSpec.hs+41 tests/Spec.hs → httpbin-tests/Spec.hs tests/Network/HTTP/ReqSpec.hs → pure-tests/Network/HTTP/ReqSpec.hs+2−1 pure-tests/Spec.hs+1 req.cabal+17−3
httpbin-tests/Network/HTTP/ReqSpec.hsnew file+41
@@ -0,0 +1,41 @@
1+--
2+-- Tests for ‘req’ package. This test suite tests sending actual requests
3+-- using the <https://httpbin.org> service.
4+--
5+-- Copyright © 2016 Mark Karpov <markkarpov@openmailbox.org>
6+--
7+-- Redistribution and use in source and binary forms, with or without
8+-- modification, are permitted provided that the following conditions are
9+-- met:
10+--
11+-- * Redistributions of source code must retain the above copyright notice,
12+-- this list of conditions and the following disclaimer.
13+--
14+-- * Redistributions in binary form must reproduce the above copyright
15+-- notice, this list of conditions and the following disclaimer in the
16+-- documentation and/or other materials provided with the distribution.
17+--
18+-- * Neither the name Mark Karpov nor the names of contributors may be used
19+-- to endorse or promote products derived from this software without
20+-- specific prior written permission.
21+--
22+-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS “AS IS” AND ANY
23+-- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24+-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25+-- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
26+-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27+-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28+-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29+-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30+-- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31+-- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+-- POSSIBILITY OF SUCH DAMAGE.
33+
34+module Network.HTTP.ReqSpec
35+ ( spec )
36+where
37+
38+import Test.Hspec
39+
40+spec :: Spec
41+spec = return ()
tests/Spec.hs → httpbin-tests/Spec.hsrenamed

The content is the same.

tests/Network/HTTP/ReqSpec.hs → pure-tests/Network/HTTP/ReqSpec.hsrenamed+2−1
@@ -1,5 +1,6 @@
11--
2−-- Tests for ‘req’ package.
2+-- Tests for ‘req’ package. This test suite tests correctness of constructed
3+-- requests.
34--
45-- Copyright © 2016 Mark Karpov <markkarpov@openmailbox.org>
56--
pure-tests/Spec.hsnew file+1
@@ -0,0 +1 @@
1+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
req.cabal+17−3
@@ -82,12 +82,12 @@ library
8282 ghc-options: -O2 -Wall
8383 default-language: Haskell2010
8484
85−test-suite tests
85+test-suite pure-tests
8686 main-is: Spec.hs
8787 other-modules: Network.HTTP.ReqSpec
88− hs-source-dirs: tests
88+ hs-source-dirs: pure-tests
8989 type: exitcode-stdio-1.0
90− build-depends: QuickCheck >= 2.7 && < 3.0
90+ build-depends: QuickCheck >= 2.7 && < 3.0
9191 , base >= 4.7 && < 5.0
9292 , hspec >= 2.0 && < 3.0
9393 , req >= 0.1.0
@@ -96,3 +96,17 @@ test-suite tests
9696 else
9797 ghc-options: -O2 -Wall
9898 default-language: Haskell2010
99+
100+test-suite httpbin-tests
101+ main-is: Spec.hs
102+ other-modules: Network.HTTP.ReqSpec
103+ hs-source-dirs: httpbin-tests
104+ type: exitcode-stdio-1.0
105+ build-depends: base >= 4.7 && < 5.0
106+ , hspec >= 2.0 && < 3.0
107+ , req >= 0.1.0
108+ if flag(dev)
109+ ghc-options: -Wall -Werror
110+ else
111+ ghc-options: -O2 -Wall
112+ default-language: Haskell2010