on master help sign in
Move from test-framework to tasty
2db34f0Jasper Van der Jeugt
hakyll.cabal+5−7
@@ -232,18 +232,16 @@ Test-suite hakyll-tests
232 TestSuite.Util
232 TestSuite.Util
233
233
234 Build-Depends:
234 Build-Depends:
235− HUnit >= 1.2 && < 1.4,
236− QuickCheck >= 2.4 && < 2.9,
235+ QuickCheck >= 2.8 && < 2.9,
237− test-framework >= 0.4 && < 0.9,
236+ tasty >= 0.11 && < 0.12,
238− test-framework-hunit >= 0.3 && < 0.4,
237+ tasty-hunit >= 0.9 && < 0.10,
239− test-framework-quickcheck2 >= 0.3 && < 0.4,
238+ tasty-quickcheck >= 0.8 && < 0.9,
240 -- Copy pasted from hakyll dependencies:
239 -- Copy pasted from hakyll dependencies:
241 base >= 4.8 && < 5,
240 base >= 4.8 && < 5,
242 binary >= 0.5 && < 0.9,
241 binary >= 0.5 && < 0.9,
243 blaze-html >= 0.5 && < 0.9,
242 blaze-html >= 0.5 && < 0.9,
244 blaze-markup >= 0.5.1 && < 0.8,
243 blaze-markup >= 0.5.1 && < 0.8,
245 bytestring >= 0.9 && < 0.11,
244 bytestring >= 0.9 && < 0.11,
246− cmdargs >= 0.10 && < 0.11,
247 containers >= 0.3 && < 0.6,
245 containers >= 0.3 && < 0.6,
248 cryptohash >= 0.7 && < 0.12,
246 cryptohash >= 0.7 && < 0.12,
249 data-default >= 0.4 && < 0.8,
247 data-default >= 0.4 && < 0.8,
@@ -269,7 +267,7 @@ Test-suite hakyll-tests
269 time-locale-compat >= 0.1 && < 0.2,
267 time-locale-compat >= 0.1 && < 0.2,
270 unordered-containers >= 0.2 && < 0.3,
268 unordered-containers >= 0.2 && < 0.3,
271 vector >= 0.11 && < 0.12,
269 vector >= 0.11 && < 0.12,
272− yaml >= 0.8.11 && < 0.9,
270+ yaml >= 0.8.11 && < 0.9,
273 optparse-applicative >= 0.12 && < 0.13
271 optparse-applicative >= 0.12 && < 0.13
274
272
275 If flag(previewServer)
273 If flag(previewServer)
src/Hakyll/Check.hs+1−1
@@ -204,7 +204,7 @@ checkExternalUrl url = do
204 result <- liftIO $ try $ do
204 result <- liftIO $ try $ do
205 mgr <- Http.newManager Http.tlsManagerSettings
205 mgr <- Http.newManager Http.tlsManagerSettings
206 runResourceT $ do
206 runResourceT $ do
207− request <- Http.parseUrl urlToCheck
207+ request <- Http.parseRequest urlToCheck
208 response <- Http.http (settings request) mgr
208 response <- Http.http (settings request) mgr
209 let code = Http.statusCode (Http.responseStatus response)
209 let code = Http.statusCode (Http.responseStatus response)
210 return $ code >= 200 && code < 300
210 return $ code >= 200 && code < 300
stack.yaml+2−2
@@ -1,6 +1,6 @@
1−resolver: lts-5.11
1+resolver: lts-6.22
2−extra-deps: []
3extra-package-dbs: []
2extra-package-dbs: []
3+extra-deps: []
4
4
5flags:
5flags:
6 hakyll:
6 hakyll:
tests/Hakyll/Core/Dependencies/Tests.hs+3−3
@@ -9,8 +9,8 @@ module Hakyll.Core.Dependencies.Tests
9import Data.List (delete)
9import Data.List (delete)
10import qualified Data.Map as M
10import qualified Data.Map as M
11import qualified Data.Set as S
11import qualified Data.Set as S
12−import Test.Framework (Test, testGroup)
12+import Test.Tasty (TestTree, testGroup)
13−import Test.HUnit (Assertion, (@=?))
13+import Test.Tasty.HUnit (Assertion, (@=?))
14
14
15
15
16--------------------------------------------------------------------------------
16--------------------------------------------------------------------------------
@@ -20,7 +20,7 @@ import TestSuite.Util
20
20
21
21
22--------------------------------------------------------------------------------
22--------------------------------------------------------------------------------
23−tests :: Test
23+tests :: TestTree
24tests = testGroup "Hakyll.Core.Dependencies.Tests" $
24tests = testGroup "Hakyll.Core.Dependencies.Tests" $
25 fromAssertions "analyze" [case01, case02, case03]
25 fromAssertions "analyze" [case01, case02, case03]
26
26
tests/Hakyll/Core/Identifier/Tests.hs+5−5
@@ -6,8 +6,8 @@ module Hakyll.Core.Identifier.Tests
6
6
7
7
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9−import Test.Framework (Test, testGroup)
9+import Test.Tasty (TestTree, testGroup)
10−import Test.HUnit ((@=?))
10+import Test.Tasty.HUnit ((@=?))
11
11
12
12
13--------------------------------------------------------------------------------
13--------------------------------------------------------------------------------
@@ -17,7 +17,7 @@ import TestSuite.Util
17
17
18
18
19--------------------------------------------------------------------------------
19--------------------------------------------------------------------------------
20−tests :: Test
20+tests :: TestTree
21tests = testGroup "Hakyll.Core.Identifier.Tests" $ concat
21tests = testGroup "Hakyll.Core.Identifier.Tests" $ concat
22 [ captureTests
22 [ captureTests
23 , matchesTests
23 , matchesTests
@@ -25,7 +25,7 @@ tests = testGroup "Hakyll.Core.Identifier.Tests" $ concat
25
25
26
26
27--------------------------------------------------------------------------------
27--------------------------------------------------------------------------------
28−captureTests :: [Test]
28+captureTests :: [TestTree]
29captureTests = fromAssertions "capture"
29captureTests = fromAssertions "capture"
30 [ Just ["bar"] @=? capture "foo/**" "foo/bar"
30 [ Just ["bar"] @=? capture "foo/**" "foo/bar"
31 , Just ["foo/bar"] @=? capture "**" "foo/bar"
31 , Just ["foo/bar"] @=? capture "**" "foo/bar"
@@ -46,7 +46,7 @@ captureTests = fromAssertions "capture"
46
46
47
47
48--------------------------------------------------------------------------------
48--------------------------------------------------------------------------------
49−matchesTests :: [Test]
49+matchesTests :: [TestTree]
50matchesTests = fromAssertions "matches"
50matchesTests = fromAssertions "matches"
51 [ True @=? matches (fromList ["foo.markdown"]) "foo.markdown"
51 [ True @=? matches (fromList ["foo.markdown"]) "foo.markdown"
52 , False @=? matches (fromList ["foo"]) (setVersion (Just "x") "foo")
52 , False @=? matches (fromList ["foo"]) (setVersion (Just "x") "foo")
tests/Hakyll/Core/Provider/Metadata/Tests.hs+3−3
@@ -10,13 +10,13 @@ import qualified Data.Text as T
10import qualified Data.Yaml as Yaml
10import qualified Data.Yaml as Yaml
11import Hakyll.Core.Metadata
11import Hakyll.Core.Metadata
12import Hakyll.Core.Provider.Metadata
12import Hakyll.Core.Provider.Metadata
13−import Test.Framework (Test, testGroup)
13+import Test.Tasty (TestTree, testGroup)
14−import Test.HUnit (Assertion, (@=?), assertFailure)
14+import Test.Tasty.HUnit (Assertion, assertFailure, (@=?))
15import TestSuite.Util
15import TestSuite.Util
16
16
17
17
18--------------------------------------------------------------------------------
18--------------------------------------------------------------------------------
19−tests :: Test
19+tests :: TestTree
20tests = testGroup "Hakyll.Core.Provider.Metadata.Tests" $
20tests = testGroup "Hakyll.Core.Provider.Metadata.Tests" $
21 fromAssertions "page" [testPage01, testPage02]
21 fromAssertions "page" [testPage01, testPage02]
22
22
tests/Hakyll/Core/Provider/Tests.hs+3−4
@@ -8,14 +8,13 @@ module Hakyll.Core.Provider.Tests
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9import Hakyll.Core.Metadata
9import Hakyll.Core.Metadata
10import Hakyll.Core.Provider
10import Hakyll.Core.Provider
11−import Test.Framework (Test, testGroup)
11+import Test.Tasty (TestTree, testGroup)
12−import Test.Framework.Providers.HUnit (testCase)
13−import Test.HUnit (Assertion, assert, (@=?))
12+import Test.Tasty.HUnit (Assertion, assert, testCase, (@=?))
14import TestSuite.Util
13import TestSuite.Util
15
14
16
15
17--------------------------------------------------------------------------------
16--------------------------------------------------------------------------------
18−tests :: Test
17+tests :: TestTree
19tests = testGroup "Hakyll.Core.Provider.Tests"
18tests = testGroup "Hakyll.Core.Provider.Tests"
20 [ testCase "case01" case01
19 [ testCase "case01" case01
21 ]
20 ]
tests/Hakyll/Core/Routes/Tests.hs+3−3
@@ -11,13 +11,13 @@ import Hakyll.Core.Identifier
11import Hakyll.Core.Metadata
11import Hakyll.Core.Metadata
12import Hakyll.Core.Routes
12import Hakyll.Core.Routes
13import System.FilePath ((</>))
13import System.FilePath ((</>))
14−import Test.Framework (Test, testGroup)
14+import Test.Tasty (TestTree, testGroup)
15−import Test.HUnit (Assertion, (@=?))
15+import Test.Tasty.HUnit (Assertion, (@=?))
16import TestSuite.Util
16import TestSuite.Util
17
17
18
18
19--------------------------------------------------------------------------------
19--------------------------------------------------------------------------------
20−tests :: Test
20+tests :: TestTree
21tests = testGroup "Hakyll.Core.Routes.Tests" $ fromAssertions "runRoutes"
21tests = testGroup "Hakyll.Core.Routes.Tests" $ fromAssertions "runRoutes"
22 [ testRoutes "foo.html" (setExtension "html") "foo"
22 [ testRoutes "foo.html" (setExtension "html") "foo"
23 , testRoutes "foo.html" (setExtension ".html") "foo"
23 , testRoutes "foo.html" (setExtension ".html") "foo"
tests/Hakyll/Core/Rules/Tests.hs+3−3
@@ -19,13 +19,13 @@ import Hakyll.Core.Rules
19import Hakyll.Core.Rules.Internal
19import Hakyll.Core.Rules.Internal
20import Hakyll.Web.Pandoc
20import Hakyll.Web.Pandoc
21import System.FilePath ((</>))
21import System.FilePath ((</>))
22−import Test.Framework (Test, testGroup)
22+import Test.Tasty (TestTree, testGroup)
23−import Test.HUnit (Assertion, assert, (@=?))
23+import Test.Tasty.HUnit (Assertion, assert, (@=?))
24import TestSuite.Util
24import TestSuite.Util
25
25
26
26
27--------------------------------------------------------------------------------
27--------------------------------------------------------------------------------
28−tests :: Test
28+tests :: TestTree
29tests = testGroup "Hakyll.Core.Rules.Tests" $ fromAssertions "runRules"
29tests = testGroup "Hakyll.Core.Rules.Tests" $ fromAssertions "runRules"
30 [case01]
30 [case01]
31
31
tests/Hakyll/Core/Runtime/Tests.hs+3−3
@@ -8,8 +8,8 @@ module Hakyll.Core.Runtime.Tests
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9import qualified Data.ByteString as B
9import qualified Data.ByteString as B
10import System.FilePath ((</>))
10import System.FilePath ((</>))
11−import Test.Framework (Test, testGroup)
11+import Test.Tasty (TestTree, testGroup)
12−import Test.HUnit (Assertion, (@?=))
12+import Test.Tasty.HUnit (Assertion, (@?=))
13
13
14
14
15--------------------------------------------------------------------------------
15--------------------------------------------------------------------------------
@@ -20,7 +20,7 @@ import TestSuite.Util
20
20
21
21
22--------------------------------------------------------------------------------
22--------------------------------------------------------------------------------
23−tests :: Test
23+tests :: TestTree
24tests = testGroup "Hakyll.Core.Runtime.Tests" $
24tests = testGroup "Hakyll.Core.Runtime.Tests" $
25 fromAssertions "run" [case01, case02]
25 fromAssertions "run" [case01, case02]
26
26
tests/Hakyll/Core/Store/Tests.hs+9−9
@@ -6,22 +6,22 @@ module Hakyll.Core.Store.Tests
6
6
7
7
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9−import Data.Typeable (typeOf)
9+import Data.Typeable (typeOf)
10+import qualified Test.QuickCheck as Q
11+import qualified Test.QuickCheck.Monadic as Q
10−import Test.Framework (Test, testGroup)
12+import Test.Tasty (TestTree, testGroup)
11−import Test.Framework.Providers.HUnit (testCase)
13+import Test.Tasty.HUnit (testCase)
12−import Test.Framework.Providers.QuickCheck2 (testProperty)
13−import qualified Test.HUnit as H
14+import qualified Test.Tasty.HUnit as H
14−import qualified Test.QuickCheck as Q
15+import Test.Tasty.QuickCheck (testProperty)
15−import qualified Test.QuickCheck.Monadic as Q
16
16
17
17
18--------------------------------------------------------------------------------
18--------------------------------------------------------------------------------
19−import qualified Hakyll.Core.Store as Store
19+import qualified Hakyll.Core.Store as Store
20import TestSuite.Util
20import TestSuite.Util
21
21
22
22
23--------------------------------------------------------------------------------
23--------------------------------------------------------------------------------
24−tests :: Test
24+tests :: TestTree
25tests = testGroup "Hakyll.Core.Store.Tests"
25tests = testGroup "Hakyll.Core.Store.Tests"
26 [ testProperty "simple get . set" simpleSetGet
26 [ testProperty "simple get . set" simpleSetGet
27 , testProperty "persistent get . set" persistentSetGet
27 , testProperty "persistent get . set" persistentSetGet
tests/Hakyll/Core/UnixFilter/Tests.hs+5−5
@@ -6,10 +6,10 @@ module Hakyll.Core.UnixFilter.Tests
6
6
7
7
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9−import Data.List (isInfixOf)
9+import Data.List (isInfixOf)
10−import Test.Framework (Test, testGroup)
10+import Test.Tasty (TestTree, testGroup)
11−import Test.Framework.Providers.HUnit (testCase)
11+import Test.Tasty.HUnit (testCase)
12−import qualified Test.HUnit as H
12+import qualified Test.Tasty.HUnit as H
13
13
14
14
15--------------------------------------------------------------------------------
15--------------------------------------------------------------------------------
@@ -21,7 +21,7 @@ import TestSuite.Util
21
21
22
22
23--------------------------------------------------------------------------------
23--------------------------------------------------------------------------------
24−tests :: Test
24+tests :: TestTree
25tests = testGroup "Hakyll.Core.UnixFilter.Tests"
25tests = testGroup "Hakyll.Core.UnixFilter.Tests"
26 [ testCase "unixFilter rev" unixFilterRev
26 [ testCase "unixFilter rev" unixFilterRev
27 , testCase "unixFilter false" unixFilterFalse
27 , testCase "unixFilter false" unixFilterFalse
tests/Hakyll/Core/Util/String/Tests.hs+3−3
@@ -5,8 +5,8 @@ module Hakyll.Core.Util.String.Tests
5
5
6
6
7--------------------------------------------------------------------------------
7--------------------------------------------------------------------------------
8−import Test.Framework (Test, testGroup)
8+import Test.Tasty (TestTree, testGroup)
9−import Test.HUnit ((@=?))
9+import Test.Tasty.HUnit ((@=?))
10
10
11
11
12--------------------------------------------------------------------------------
12--------------------------------------------------------------------------------
@@ -15,7 +15,7 @@ import TestSuite.Util
15
15
16
16
17--------------------------------------------------------------------------------
17--------------------------------------------------------------------------------
18−tests :: Test
18+tests :: TestTree
19tests = testGroup "Hakyll.Core.Util.String.Tests" $ concat
19tests = testGroup "Hakyll.Core.Util.String.Tests" $ concat
20 [ fromAssertions "trim"
20 [ fromAssertions "trim"
21 [ "foo" @=? trim " foo\n\t "
21 [ "foo" @=? trim " foo\n\t "
tests/Hakyll/Web/CompressCss/Tests.hs+6−6
@@ -5,9 +5,9 @@ module Hakyll.Web.CompressCss.Tests
5
5
6
6
7--------------------------------------------------------------------------------
7--------------------------------------------------------------------------------
8−import Data.Char (toUpper)
8+import Data.Char (toUpper)
9−import Test.Framework (Test, testGroup)
9+import Test.Tasty (TestTree, testGroup)
10−import Test.HUnit (assert, (@=?))
10+import Test.Tasty.HUnit (assert, (@=?))
11
11
12
12
13--------------------------------------------------------------------------------
13--------------------------------------------------------------------------------
@@ -16,10 +16,10 @@ import TestSuite.Util
16
16
17
17
18--------------------------------------------------------------------------------
18--------------------------------------------------------------------------------
19−tests :: Test
19+tests :: TestTree
20tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat
20tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat
21 [ fromAssertions "compressCss"
21 [ fromAssertions "compressCss"
22− [
22+ [
23 -- compress whitespace
23 -- compress whitespace
24 " something something " @=?
24 " something something " @=?
25 compressCss " something \n\t\r something "
25 compressCss " something \n\t\r something "
@@ -32,7 +32,7 @@ tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat
32 -- strip comments
32 -- strip comments
33 , "before after" @=? compressCss "before /* abc { } ;; \n\t\r */ after"
33 , "before after" @=? compressCss "before /* abc { } ;; \n\t\r */ after"
34 -- don't strip comments inside constants
34 -- don't strip comments inside constants
35− , "before \"/* abc { } ;; \n\t\r */\" after"
35+ , "before \"/* abc { } ;; \n\t\r */\" after"
36 @=? compressCss "before \"/* abc { } ;; \n\t\r */\" after"
36 @=? compressCss "before \"/* abc { } ;; \n\t\r */\" after"
37
37
38 -- compress separators
38 -- compress separators
tests/Hakyll/Web/Html/RelativizeUrls/Tests.hs+4−3
@@ -6,8 +6,9 @@ module Hakyll.Web.Html.RelativizeUrls.Tests
6
6
7
7
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9−import Test.Framework (Test, testGroup)
9+import Test.Tasty (TestTree, testGroup)
10−import Test.HUnit ((@=?))
10+import Test.Tasty.HUnit ((@=?))
11+
11
12
12--------------------------------------------------------------------------------
13--------------------------------------------------------------------------------
13import Hakyll.Web.Html.RelativizeUrls
14import Hakyll.Web.Html.RelativizeUrls
@@ -15,7 +16,7 @@ import TestSuite.Util
15
16
16
17
17--------------------------------------------------------------------------------
18--------------------------------------------------------------------------------
18−tests :: Test
19+tests :: TestTree
19tests = testGroup "Hakyll.Web.Html.RelativizeUrls.Tests" $
20tests = testGroup "Hakyll.Web.Html.RelativizeUrls.Tests" $
20 fromAssertions "relativizeUrls"
21 fromAssertions "relativizeUrls"
21 [ "<a href=\"../foo\">bar</a>" @=?
22 [ "<a href=\"../foo\">bar</a>" @=?
tests/Hakyll/Web/Html/Tests.hs+4−4
@@ -5,9 +5,9 @@ module Hakyll.Web.Html.Tests
5
5
6
6
7--------------------------------------------------------------------------------
7--------------------------------------------------------------------------------
8−import Data.Char (toUpper)
8+import Data.Char (toUpper)
9−import Test.Framework (Test, testGroup)
9+import Test.Tasty (TestTree, testGroup)
10−import Test.HUnit (assert, (@=?))
10+import Test.Tasty.HUnit (assert, (@=?))
11
11
12
12
13--------------------------------------------------------------------------------
13--------------------------------------------------------------------------------
@@ -16,7 +16,7 @@ import TestSuite.Util
16
16
17
17
18--------------------------------------------------------------------------------
18--------------------------------------------------------------------------------
19−tests :: Test
19+tests :: TestTree
20tests = testGroup "Hakyll.Web.Html.Tests" $ concat
20tests = testGroup "Hakyll.Web.Html.Tests" $ concat
21 [ fromAssertions "demoteHeaders"
21 [ fromAssertions "demoteHeaders"
22 [ "<h2>A h1 title</h2>" @=?
22 [ "<h2>A h1 title</h2>" @=?
tests/Hakyll/Web/Pandoc/FileType/Tests.hs+3−3
@@ -6,8 +6,8 @@ module Hakyll.Web.Pandoc.FileType.Tests
6
6
7
7
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9−import Test.Framework (Test, testGroup)
9+import Test.Tasty (TestTree, testGroup)
10−import Test.HUnit ((@=?))
10+import Test.Tasty.HUnit ((@=?))
11
11
12
12
13--------------------------------------------------------------------------------
13--------------------------------------------------------------------------------
@@ -16,7 +16,7 @@ import TestSuite.Util
16
16
17
17
18--------------------------------------------------------------------------------
18--------------------------------------------------------------------------------
19−tests :: Test
19+tests :: TestTree
20tests = testGroup "Hakyll.Web.Pandoc.FileType.Tests" $
20tests = testGroup "Hakyll.Web.Pandoc.FileType.Tests" $
21 fromAssertions "fileType"
21 fromAssertions "fileType"
22 [ Markdown @=? fileType "index.md"
22 [ Markdown @=? fileType "index.md"
tests/Hakyll/Web/Template/Context/Tests.hs+4−5
@@ -6,22 +6,21 @@ module Hakyll.Web.Template.Context.Tests
6
6
7
7
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9−import Test.Framework (Test, testGroup)
9+import Test.Tasty (TestTree, testGroup)
10−import Test.Framework.Providers.HUnit (testCase)
10+import Test.Tasty.HUnit (Assertion, testCase, (@=?))
11−import Test.HUnit (Assertion, (@=?))
12
11
13
12
14--------------------------------------------------------------------------------
13--------------------------------------------------------------------------------
15import Hakyll.Core.Compiler
14import Hakyll.Core.Compiler
16import Hakyll.Core.Identifier
15import Hakyll.Core.Identifier
17import Hakyll.Core.Provider
16import Hakyll.Core.Provider
18−import Hakyll.Core.Store (Store)
17+import Hakyll.Core.Store (Store)
19import Hakyll.Web.Template.Context
18import Hakyll.Web.Template.Context
20import TestSuite.Util
19import TestSuite.Util
21
20
22
21
23--------------------------------------------------------------------------------
22--------------------------------------------------------------------------------
24−tests :: Test
23+tests :: TestTree
25tests = testGroup "Hakyll.Core.Template.Context.Tests"
24tests = testGroup "Hakyll.Core.Template.Context.Tests"
26 [ testCase "testDateField" testDateField
25 [ testCase "testDateField" testDateField
27 ]
26 ]
tests/Hakyll/Web/Template/Tests.hs+4−4
@@ -6,9 +6,9 @@ module Hakyll.Web.Template.Tests
6
6
7
7
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9−import Test.Framework (Test, testGroup)
9+import Test.Tasty (TestTree, testGroup)
10−import Test.Framework.Providers.HUnit (testCase)
10+import Test.Tasty.HUnit (Assertion, testCase, (@=?),
11−import Test.HUnit (Assertion, (@=?), (@?=))
11+ (@?=))
12
12
13
13
14--------------------------------------------------------------------------------
14--------------------------------------------------------------------------------
@@ -25,7 +25,7 @@ import TestSuite.Util
25
25
26
26
27--------------------------------------------------------------------------------
27--------------------------------------------------------------------------------
28−tests :: Test
28+tests :: TestTree
29tests = testGroup "Hakyll.Core.Template.Tests" $ concat
29tests = testGroup "Hakyll.Core.Template.Tests" $ concat
30 [ [ testCase "case01" $ test ("template.html.out", "template.html", "example.md")
30 [ [ testCase "case01" $ test ("template.html.out", "template.html", "example.md")
31 , testCase "case02" $ test ("strip.html.out", "strip.html", "example.md")
31 , testCase "case02" $ test ("strip.html.out", "strip.html", "example.md")
tests/TestSuite.hs+2−2
@@ -5,7 +5,7 @@ module Main
5
5
6
6
7--------------------------------------------------------------------------------
7--------------------------------------------------------------------------------
8−import Test.Framework (defaultMain)
8+import Test.Tasty (defaultMain, testGroup)
9
9
10
10
11--------------------------------------------------------------------------------
11--------------------------------------------------------------------------------
@@ -29,7 +29,7 @@ import qualified Hakyll.Web.Template.Tests
29
29
30--------------------------------------------------------------------------------
30--------------------------------------------------------------------------------
31main :: IO ()
31main :: IO ()
32−main = defaultMain
32+main = defaultMain $ testGroup "Hakyll"
33 [ Hakyll.Core.Dependencies.Tests.tests
33 [ Hakyll.Core.Dependencies.Tests.tests
34 , Hakyll.Core.Identifier.Tests.tests
34 , Hakyll.Core.Identifier.Tests.tests
35 , Hakyll.Core.Provider.Metadata.Tests.tests
35 , Hakyll.Core.Provider.Metadata.Tests.tests
tests/TestSuite/Util.hs+10−11
@@ -12,30 +12,29 @@ module TestSuite.Util
12
12
13
13
14--------------------------------------------------------------------------------
14--------------------------------------------------------------------------------
15−import Data.List (intercalate)
15+import Data.List (intercalate)
16−import Data.Monoid (mempty)
16+import Data.Monoid (mempty)
17−import qualified Data.Set as S
17+import qualified Data.Set as S
18−import Test.Framework
18+import Test.Tasty
19−import Test.Framework.Providers.HUnit
19+import Test.Tasty.HUnit
20−import Test.HUnit hiding (Test)
21−import Text.Printf (printf)
20+import Text.Printf (printf)
22
21
23
22
24--------------------------------------------------------------------------------
23--------------------------------------------------------------------------------
25import Hakyll.Core.Compiler.Internal
24import Hakyll.Core.Compiler.Internal
26import Hakyll.Core.Configuration
25import Hakyll.Core.Configuration
27import Hakyll.Core.Identifier
26import Hakyll.Core.Identifier
28−import qualified Hakyll.Core.Logger as Logger
27+import qualified Hakyll.Core.Logger as Logger
29import Hakyll.Core.Provider
28import Hakyll.Core.Provider
30−import Hakyll.Core.Store (Store)
29+import Hakyll.Core.Store (Store)
31−import qualified Hakyll.Core.Store as Store
30+import qualified Hakyll.Core.Store as Store
32import Hakyll.Core.Util.File
31import Hakyll.Core.Util.File
33
32
34
33
35--------------------------------------------------------------------------------
34--------------------------------------------------------------------------------
36fromAssertions :: String -- ^ Name
35fromAssertions :: String -- ^ Name
37 -> [Assertion] -- ^ Cases
36 -> [Assertion] -- ^ Cases
38− -> [Test] -- ^ Result tests
37+ -> [TestTree] -- ^ Result tests
39fromAssertions name =
38fromAssertions name =
40 zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
39 zipWith testCase [printf "[%2d] %s" n name | n <- [1 :: Int ..]]
41
40