diff options
-rw-r--r-- | tests/loc.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/loc.hs b/tests/loc.hs new file mode 100644 index 0000000..cfc9985 --- /dev/null +++ b/tests/loc.hs @@ -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 |