Skip to content

Commit

Permalink
More test cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ohbadiah committed Dec 20, 2011
1 parent 4af152d commit f97a797
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CMUPronouncingDictionary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module CMUPronouncingDictionary (
testWordVision, testWordFox,
testLineFoxPox, testLineVisionTransfusion,
testLineTransfusion, testLinePox,
testLineVision, testLineFox, CMUPronouncingDictionary.dictTest,
testLineVision, testLineFox, CMUPronouncingDictionary.test,
syllables, phonemes
) where

Expand Down Expand Up @@ -195,8 +195,8 @@ testIsStressPhoneme = "Test isStressPhoneme" ~: TestList [
isStressPhoneme "VERYLONG1" ~?= True
]

dictTest :: IO ()
dictTest = do
test :: IO ()
test = do
runTestTT (TestList [
testWordToLine,
testSyllables,
Expand Down
11 changes: 4 additions & 7 deletions PoemAnalyzer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ testGetWords :: Test
testGetWords = "Test getWords" ~: TestList [
"fox" ~: getWords ["fox"] testDictionary ~?= [[justFox]],
"fox with breaks" ~: getWords ["fox", "\n", "fox", "fox"] testDictionary ~?=
[[justFox], [justFox, justFox]]
[[justFox], [], [justFox], [justFox]]
] where
justFox = Just testWordFox

testDictionary :: Dictionary
testDictionary = Map.fromList [
("fox", testWordFox),
("pox", testWordPox)
]
testDictionary = Map.fromList [ ("fox", testWordFox), ("pox", testWordPox) ]

-- | Removes all Nothing's from the list and collapses entries
justWords :: [[Maybe Word]] -> [[Word]]
Expand Down Expand Up @@ -52,8 +49,8 @@ testWords :: [Word]
testWords = [testWordFox, testWordPox]


analyzeTest :: IO ()
analyzeTest = do
test :: IO ()
test = do
runTestTT (TestList [
testGetWord,
testJustWords,
Expand Down

0 comments on commit f97a797

Please sign in to comment.