Merge branch 'master' of github.com:yogsototh/holy-project
This commit is contained in:
commit
76f797700d
7 changed files with 47 additions and 25 deletions
23
auto-update
23
auto-update
|
@ -1,11 +1,26 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
autoload colors
|
||||
colors
|
||||
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do
|
||||
eval $COLOR='$fg_no_bold[${(L)COLOR}]'
|
||||
eval BOLD_$COLOR='$fg_bold[${(L)COLOR}]'
|
||||
done
|
||||
eval RESET='$reset_color'
|
||||
|
||||
latestThread=0
|
||||
relaunchCompilation() {
|
||||
while read line; do
|
||||
if (( $( print -- $line | grep '.cabal-sandbox' | wc -l) == 0 )); then
|
||||
print "$line"
|
||||
cabal install && \
|
||||
./.cabal-sandbox/bin/test-holy-project
|
||||
(($latestThread>0)) && \
|
||||
(( $(ps x | awk "\$1 == $latestThread" | wc -l)>0 )) && {
|
||||
print -- "\n${RED}STOPPED${RESET}"
|
||||
kill $latestThread
|
||||
}
|
||||
print "${BLUE}$line${RESET}"
|
||||
{ cabal install && \
|
||||
./.cabal-sandbox/bin/test-holy-project } &
|
||||
latestThread=$!
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -22,7 +37,7 @@ Darwin)
|
|||
tmp=$(date +"%s")
|
||||
t=$tmp
|
||||
while true; do
|
||||
tmp=$t
|
||||
tmp=$(( $t - 1 ))
|
||||
t=$(date +"%s")
|
||||
for fic in {src,test}/**/*.hs(.) *.cabal; do
|
||||
# note to use on OS X, use "stat -f %m $checkfile" instead
|
||||
|
|
|
@ -56,7 +56,7 @@ executable holy-project
|
|||
|
||||
library
|
||||
exposed-modules: HolyProject
|
||||
, HolyProject.Swallow
|
||||
, HolyProject.StringUtils
|
||||
, HolyProject.Coconut
|
||||
-- other-modules:
|
||||
-- other-extensions:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
module HolyProject.Swallow (swallow) where
|
||||
|
||||
swallow :: String -> String -> String
|
||||
swallow prefix suffix = prefix ++ suffix
|
22
test/HolyProject/StringUtils/Test.hs
Normal file
22
test/HolyProject/StringUtils/Test.hs
Normal file
|
@ -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
|
|
@ -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"
|
|
@ -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
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue