Split host tests by component ownership
This commit is contained in:
parent
68a92662c0
commit
48a5b8a433
1 changed files with 1435 additions and 1309 deletions
23
test/Nuthatch/Test/PathFixture.hs
Normal file
23
test/Nuthatch/Test/PathFixture.hs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
module Nuthatch.Test.PathFixture
|
||||
( ValidPath (..)
|
||||
, genValidPath
|
||||
) where
|
||||
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import Hedgehog (Gen)
|
||||
import qualified Hedgehog.Gen as Gen
|
||||
import qualified Hedgehog.Range as Range
|
||||
|
||||
newtype ValidPath = ValidPath { getValidPath :: Text }
|
||||
deriving stock (Show)
|
||||
|
||||
genValidPath :: Gen ValidPath
|
||||
genValidPath = do
|
||||
segments <- Gen.list (Range.linear 1 6) genSegment
|
||||
pure (ValidPath (T.intercalate "/" segments))
|
||||
where
|
||||
genSegment =
|
||||
Gen.filter (`notElem` [".", ".."]) $
|
||||
Gen.text (Range.linear 1 16) $
|
||||
Gen.choice [Gen.alphaNum, Gen.element ("_-. " :: String)]
|
||||
Loading…
Reference in a new issue