define test to ensure LOC doesn't jump above 400.

This commit is contained in:
David Roundy
2007-04-18 00:45:33 +00:00
parent 34e6bf6ed2
commit dd03052041

15
tests/loc.hs Normal file
View File

@@ -0,0 +1,15 @@
import Control.Monad
import System.Exit
main = do foo <- getContents
let actual_loc = filter isntcomment $
map (dropWhile (==' ')) $ lines foo
loc = length actual_loc
putStrLn $ show loc
-- uncomment the following to check for mistakes in isntcomment
-- putStr $ unlines $ actual_loc
when (loc > 400) $ fail "Too many lines of code!"
isntcomment "" = False
isntcomment ('-':'-':_) = False
isntcomment _ = True