<commit_before>{-# LANGUAGE FlexibleContexts #-}

module Test.Smoke.PathsSpec where

import Control.Monad.IO.Class (liftIO)
import qualified Data.List as List
import HaskellWorks.Hspec.Hedgehog
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import qualified System.Directory as Directory
import qualified System.FilePath as FilePath
import Test.Hspec
import Test.Smoke.Paths

spec :: Spec
spec =
  parallel $
  describe "path processing" $ do
    it "normalizes" $
      require $
      property $ do
        filePath <- forAll $ genRelativeFilePath (Range.linear 1 10)
        let path = parseFile filePath
        let rePath = parseFile $ toFilePath path
        path === rePath
    it "resolves a relative path" $
      require $<commit_msg>Don't bother running the unit tests in parallel.<commit_after>{-# LANGUAGE FlexibleContexts #-}

module Test.Smoke.PathsSpec where

import Control.Monad.IO.Class (liftIO)
import qualified Data.List as List
import HaskellWorks.Hspec.Hedgehog
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import qualified System.Directory as Directory
import qualified System.FilePath as FilePath
import Test.Hspec
import Test.Smoke.Paths

spec :: Spec
spec =
  describe "path processing" $ do
    it "normalizes" $
      require $
      property $ do
        filePath <- forAll $ genRelativeFilePath (Range.linear 1 10)
        let path = parseFile filePath
        let rePath = parseFile $ toFilePath path
        path === rePath
    it "resolves a relative path" $
      require $
{'fraction_non_alphanumeric': 0.06795511221945137, 'fraction_numerical': 0.003740648379052369, 'mean_word_length': 3.4707520891364902, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4124527', 'n_tokens_mistral': 474, 'n_tokens_neox': 443, 'n_words': 162}