mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-05 06:31:54 -07:00
define test to ensure LOC doesn't jump above 400.
This commit is contained in:
15
tests/loc.hs
Normal file
15
tests/loc.hs
Normal 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
|
Reference in New Issue
Block a user