summaryrefslogtreecommitdiffstats
path: root/tests/loc.hs
blob: cfc9985dabfc2f892f6823de613018b55c38785e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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