summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoral <>2017-11-23 20:31:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-11-23 20:31:00 (GMT)
commit3c8e26579214f0e7b482066fe912ded9f14914f5 (patch)
tree07a95aef5b605d097f145e810cd4246c37725d8a
parent0dfbdc20dd5ce9fb85dda6f40c58c56fbeec5426 (diff)
version 0.1.2.20.1.2.2
-rw-r--r--conduit-parse.cabal21
-rw-r--r--test/HLint.hs8
-rw-r--r--test/Main.hs14
3 files changed, 28 insertions, 15 deletions
diff --git a/conduit-parse.cabal b/conduit-parse.cabal
index 3be52e2..f175dc7 100644
--- a/conduit-parse.cabal
+++ b/conduit-parse.cabal
@@ -1,5 +1,5 @@
name: conduit-parse
-version: 0.1.2.1
+version: 0.1.2.2
synopsis: Parsing framework based on conduit.
description: Please refer to README.
homepage: https://github.com/k0ral/conduit-parse
@@ -16,6 +16,11 @@ source-repository head
type: git
location: git://github.com/k0ral/conduit-parse.git
+flag enable-hlint-test
+ description: Enable hlint test-suite
+ manual: True
+ default: False
+
library
exposed-modules:
Data.Conduit.Parser
@@ -44,7 +49,6 @@ test-suite tests
, conduit
, conduit-parse
, safe-exceptions
- , hlint
, mtl
, parsers
, resourcet
@@ -53,3 +57,16 @@ test-suite tests
-- , tasty-quickcheck
default-language: Haskell2010
ghc-options: -Wall -fno-warn-unused-do-bind
+
+test-suite hlint
+ if flag(enable-hlint-test)
+ buildable: True
+ else
+ buildable: False
+ type: exitcode-stdio-1.0
+ main-is: HLint.hs
+ build-depends:
+ base >=4.8,
+ hlint -any
+ default-language: Haskell2010
+ hs-source-dirs: test
diff --git a/test/HLint.hs b/test/HLint.hs
new file mode 100644
index 0000000..af15745
--- /dev/null
+++ b/test/HLint.hs
@@ -0,0 +1,8 @@
+import qualified Language.Haskell.HLint as HLint (hlint)
+import System.Exit
+
+
+main :: IO ()
+main = do
+ result <- HLint.hlint [ "test/", "Data/" ]
+ if null result then exitSuccess else exitFailure
diff --git a/test/Main.hs b/test/Main.hs
index 50c17e8..a76ecca 100644
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -4,15 +4,9 @@ import Control.Applicative
import Control.Exception.Safe as Exception
import Control.Monad.Error.Class
import Control.Monad.Trans.Resource
-
import Data.Conduit hiding (await, leftover)
-import Data.Conduit.List hiding (drop, peek)
+import Data.Conduit.List hiding (peek)
import Data.Conduit.Parser
-
-import qualified Language.Haskell.HLint as HLint (hlint)
-
-import Prelude hiding (drop)
-
import Test.Tasty
import Test.Tasty.HUnit
-- import Test.Tasty.QuickCheck
@@ -23,7 +17,6 @@ main :: IO ()
main = defaultMain $ testGroup "Tests"
[ unitTests
-- , properties
- , hlint
]
unitTests :: TestTree
@@ -40,11 +33,6 @@ unitTests = testGroup "Unit tests"
-- , parseOrSkipCase
]
-hlint :: TestTree
-hlint = testCase "HLint check" $ do
- result <- HLint.hlint [ "test/", "Data/" ]
- null result @?= True
-
awaitCase :: TestTree
awaitCase = testCase "await" $ do
i <- runResourceT . runConduit $ sourceList [1 :: Int] =$= runConduitParser parser