From dd030520413667edf56e9ad73085c60a2d688639 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Wed, 18 Apr 2007 00:45:33 +0000 Subject: [PATCH] define test to ensure LOC doesn't jump above 400. --- tests/loc.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/loc.hs 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