<commit_before>module Main where

import Language.Fay.Compiler

import Data.List
import System.Directory
import System.Exit
import System.FilePath
import System.IO
import System.Process
import Test.HUnit

-- | Main test runner.
main :: IO ()
main = runUnitTests >>= print

-- | Run the case-by-case unit tests.
runUnitTests :: IO Counts
runUnitTests = do
  files <- fmap (map ("tests" </>) . sort . filter dotHs) $ getDirectoryContents "tests"
  runTestTT (makeTests files)
  
    where dotHs = isSuffixOf ".hs"
          makeTests files =
            TestList $ flip map files $ \file -> TestLabel file $ TestCase $ do
              let root = (reverse . drop 1 . dropWhile (/='.') . reverse) file
                  out = toJsName file
              outExists <- doesFileExist root
              compileFromTo True file out<commit_msg>Don't print counts in fay-tests.<commit_after>module Main where

import Language.Fay.Compiler

import Data.List
import System.Directory
import System.Exit
import System.FilePath
import System.IO
import System.Process
import Test.HUnit

-- | Main test runner.
main :: IO ()
main = runUnitTests >> return ()

-- | Run the case-by-case unit tests.
runUnitTests :: IO Counts
runUnitTests = do
  files <- fmap (map ("tests" </>) . sort . filter dotHs) $ getDirectoryContents "tests"
  runTestTT (makeTests files)
  
    where dotHs = isSuffixOf ".hs"
          makeTests files =
            TestList $ flip map files $ \file -> TestLabel file $ TestCase $ do
              let root = (reverse . drop 1 . dropWhile (/='.') . reverse) file
                  out = toJsName file
              outExists <- doesFileExist root
              compileFromTo True file out
{'fraction_non_alphanumeric': 0.09563164108618655, 'fraction_numerical': 0.0011806375442739079, 'mean_word_length': 2.516597510373444, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2914993', 'n_tokens_mistral': 488, 'n_tokens_neox': 470, 'n_words': 167}