git @ Cat's Eye Technologies Falderal / 43ed141
A bit more shuffling. catseye 10 years ago
3 changed file(s) with 12 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
108108 foldl (++) "" (map (\x -> prefix ++ x ++ "\n") (allLines text))
109109
110110 formatLines formatter lines = foldl (++) "" (map (formatter) lines)
111
112 contains [] _ = False
113 contains (x:xs) y
114 | x == y = True
115 | otherwise = contains xs y
116
117 pad s n = padFrom s (n-(length s))
118 padFrom s n
119 | n <= 0 = s
120 | otherwise = padFrom (s ++ " ") (n-1)
0 module Test.Falderal.Loader where
1
2 -- TODO: export a more restricted interface
0 module Test.Falderal.Loader (loadFile, loadText) where
31
42 --
53 -- Test.Falderal.Loader -- The Falderal Test Loader
6969
7070 loadAndRunTests fileName funMap = do
7171 (_, blocks) <- loadFile fileName
72 tests <- return $ reDescribeBlocks blocks
73 reportTests funMap tests
72 reportTests funMap blocks
7473
7574 --
7675 -- The main test-running engine of Falderal:
134133 putStrLn text
135134 else do
136135 putStrLn ((pad fieldName width) ++ ": " ++ text)
137
138 contains [] _ = False
139 contains (x:xs) y
140 | x == y = True
141 | otherwise = contains xs y
142
143 pad s n = padFrom s (n-(length s))
144 padFrom s n
145 | n <= 0 = s
146 | otherwise = padFrom (s ++ " ") (n-1)