diff --git a/holy-project.cabal b/holy-project.cabal index cbac1a4..5603e73 100644 --- a/holy-project.cabal +++ b/holy-project.cabal @@ -56,7 +56,7 @@ executable holy-project library exposed-modules: HolyProject - , HolyProject.Swallow + , HolyProject.StringUtils , HolyProject.Coconut -- other-modules: -- other-extensions: diff --git a/src/HolyProject/GitHubAPI.hs b/src/HolyProject/GitHubAPI.hs index b203736..060d8ab 100644 --- a/src/HolyProject/GitHubAPI.hs +++ b/src/HolyProject/GitHubAPI.hs @@ -1,5 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} -module HolyProject.GitHubAPI where +module HolyProject.GitHubAPI + (searchGHUserFromEmail) +where import qualified Data.ByteString.Lazy.Char8 as LZ -- HTTP request and JSON handling diff --git a/src/HolyProject/Swallow.hs b/src/HolyProject/Swallow.hs deleted file mode 100644 index ec5b702..0000000 --- a/src/HolyProject/Swallow.hs +++ /dev/null @@ -1,4 +0,0 @@ -module HolyProject.Swallow (swallow) where - -swallow :: String -> String -> String -swallow prefix suffix = prefix ++ suffix diff --git a/test/HolyProject/StringUtils/Test.hs b/test/HolyProject/StringUtils/Test.hs new file mode 100644 index 0000000..26b2841 --- /dev/null +++ b/test/HolyProject/StringUtils/Test.hs @@ -0,0 +1,22 @@ +module HolyProject.StringUtils.Test +( stringUtilsSuite +) where +import Test.Tasty (testGroup, TestTree) +import Test.Tasty.HUnit +import HolyProject.StringUtils + +stringUtilsSuite :: TestTree +stringUtilsSuite = testGroup "StringUtils" + [ testCase "projectNameFromString space" + (testProjectNameFromString "Holy Project" "holy-project") + , testCase "projectNameFromString dash" + (testProjectNameFromString "Holy-Project" "holy-project") + , testCase "projectNameFromString caps" + (testProjectNameFromString "Holy PROJECT" "holy-project") + , testCase "projectNameFromString underscore" + (testProjectNameFromString "Holy_PROJECT" "holy_project") + ] + +testProjectNameFromString :: String -> String -> Assertion +testProjectNameFromString input expectedoutput = + expectedoutput @=? projectNameFromString input diff --git a/test/HolyProject/Swallow/Test.hs b/test/HolyProject/Swallow/Test.hs deleted file mode 100644 index 1329c2e..0000000 --- a/test/HolyProject/Swallow/Test.hs +++ /dev/null @@ -1,13 +0,0 @@ -module HolyProject.Swallow.Test - (swallowSuite) -where -import Test.Tasty (testGroup, TestTree) -import Test.Tasty.HUnit -import HolyProject.Swallow - -swallowSuite :: TestTree -swallowSuite = testGroup "Swallow" - [testCase "swallow test" testSwallow] - -testSwallow :: Assertion -testSwallow = "something" @=? swallow "some" "thing" diff --git a/test/Test.hs b/test/Test.hs index ce19fdb..ed6fd3c 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -2,7 +2,7 @@ module Main where import Test.Tasty (defaultMain,testGroup,TestTree) -import HolyProject.Swallow.Test +import HolyProject.StringUtils.Test import HolyProject.Coconut.Test main :: IO () @@ -10,6 +10,6 @@ main = defaultMain tests tests :: TestTree tests = testGroup "All Tests" - [ swallowSuite + [ stringUtilsSuite , coconutSuite ]