<commit_before>module Shaker.ListenerTest
where

import System.Time
import Control.Concurrent.MVar
import Shaker.Listener
import Shaker.Type
import Test.QuickCheck 
import Test.QuickCheck.Monadic 

prop_updateFileStat mC mM curF curM = monadicIO test
  where test = run (updateFileStat mC mM curF curM) >>
               run (readMVar mC) >>= \mCurF ->
               assert $  curF == mCurF

instance Arbitrary ClockTime where
   arbitrary = elements [1..1000] >>= \sec ->
               elements [1..1000] >>= \pico ->
               return $ TOD sec pico

instance Arbitrary FileInfo where
   arbitrary = arbitrary >>= \cl ->
               elements [".",".."] >>= \ele ->
               return $ (FileInfo ele cl)
<commit_msg>quickcheck property compile<commit_after>module Shaker.ListenerTest
where

import System.Time
import Control.Concurrent.MVar
import Control.Monad
import Shaker.Listener
import Shaker.Type
import Test.QuickCheck 
import Test.QuickCheck.Monadic 

prop_updateFileStat curF curM = 
  monadicIO (test curF curM)

test curF curM = 
  run (newMVar []) >>= \mC ->    
  run (newMVar []) >>= \mM ->    
  run (updateFileStat mC mM curF curM) >>
  run (readMVar mC) >>= \mCurF ->
  assert $  curF == mCurF

instance Arbitrary ClockTime where
   arbitrary = elements [1..1000] >>= \sec ->
               elements [1..1000] >>= \pico ->
               return $ TOD sec pico

instance Arbitrary FileInfo where
   arbitrary = arbitrary >>= \cl ->
               elements [".",".."] >>= \ele ->
               return $ (FileInfo ele cl)

{'fraction_non_alphanumeric': 0.11404639175257732, 'fraction_numerical': 0.01288659793814433, 'mean_word_length': 2.4820627802690582, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 43, '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': '917050', 'n_tokens_mistral': 507, 'n_tokens_neox': 476, 'n_words': 141}