test with IO
This commit is contained in:
parent
e37066a61a
commit
9dd6b42216
3 changed files with 25 additions and 0 deletions
|
@ -57,6 +57,7 @@ executable holy-project
|
||||||
library
|
library
|
||||||
exposed-modules: HolyProject
|
exposed-modules: HolyProject
|
||||||
, HolyProject.StringUtils
|
, HolyProject.StringUtils
|
||||||
|
, HolyProject.GithubAPI
|
||||||
, HolyProject.Coconut
|
, HolyProject.Coconut
|
||||||
-- other-modules:
|
-- other-modules:
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
|
|
22
test/HolyProject/GithubAPI/Test.hs
Normal file
22
test/HolyProject/GithubAPI/Test.hs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
module HolyProject.GithubAPI.Test
|
||||||
|
( githubAPISuite
|
||||||
|
) where
|
||||||
|
import Test.Tasty (testGroup, TestTree)
|
||||||
|
import Test.Tasty.HUnit
|
||||||
|
import HolyProject.GithubAPI
|
||||||
|
|
||||||
|
githubAPISuite :: TestTree
|
||||||
|
githubAPISuite = testGroup "GithubAPI"
|
||||||
|
[ testCase "Yann"
|
||||||
|
(ioTestEq
|
||||||
|
(searchGHUserFromEmail "Yann.Esposito@gmail.com")
|
||||||
|
(Just "\"yogsototh\""))
|
||||||
|
, testCase "Jasper"
|
||||||
|
(ioTestEq
|
||||||
|
(searchGHUserFromEmail "Jasper Van der Jeugt")
|
||||||
|
(Just "\"jaspervdj\""))
|
||||||
|
]
|
||||||
|
|
||||||
|
ioTestEq :: (Eq a, Show a) => IO a -> a -> Assertion
|
||||||
|
ioTestEq action expected = action >>= assertEqual "" expected
|
||||||
|
|
|
@ -3,6 +3,7 @@ module Main where
|
||||||
import Test.Tasty (defaultMain,testGroup,TestTree)
|
import Test.Tasty (defaultMain,testGroup,TestTree)
|
||||||
|
|
||||||
import HolyProject.StringUtils.Test
|
import HolyProject.StringUtils.Test
|
||||||
|
import HolyProject.GithubAPI.Test
|
||||||
import HolyProject.Coconut.Test
|
import HolyProject.Coconut.Test
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
@ -11,5 +12,6 @@ main = defaultMain tests
|
||||||
tests :: TestTree
|
tests :: TestTree
|
||||||
tests = testGroup "All Tests"
|
tests = testGroup "All Tests"
|
||||||
[ stringUtilsSuite
|
[ stringUtilsSuite
|
||||||
|
, githubAPISuite
|
||||||
, coconutSuite
|
, coconutSuite
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue