Get rid of the [...]AndEndWith helper

I introduced this to test a very specific edge case right after
initialization, but it made all tests harder to read.
This commit is contained in:
Sven van Heugten 2026-01-08 22:30:07 +01:00
parent c74238e105
commit 2da1972b06
2 changed files with 16 additions and 19 deletions

View file

@ -24,18 +24,12 @@ let genInitialInteractions biasTowardsLight =
Gen.listOf <| genInteraction biasTowardsLight ]
|> concatGens
let genInitialInteractionsAndEndWith biasTowardsLight (endsWith: Interaction) =
let genNonTrivialList =
genInitialInteractions biasTowardsLight
|> Gen.map (fun lst -> lst @ [ endsWith ])
match endsWith with
| Interaction.TimeChanged _ ->
let genTrivialList = Gen.constant <| List.singleton endsWith
Gen.frequency [ 1, genTrivialList; 9, genNonTrivialList ]
| _ -> genNonTrivialList
let genInteractionsExcept biasTowardsLight disqualifier =
genInteraction biasTowardsLight
|> Gen.filter (not << disqualifier)
|> Gen.listOf
let genInitialInteractionsExcept biasTowardsLight disqualifier =
[ genTimeChanged |> Gen.map List.singleton
genInteractionsExcept biasTowardsLight disqualifier ]
|> concatGens