Skip to content

Commit

Permalink
fix arbitrary P_Population
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed Sep 18, 2023
1 parent 1edda1e commit a079534
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Ampersand/Test/Parser/ArbitraryTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ instance Arbitrary TermPrim where
Pfull <$> arbitrary <*> arbitrary `suchThat` noLabel <*> arbitrary `suchThat` noLabel,
PNamedR <$> arbitrary
]
where
noMaybeLabel :: Maybe P_Concept -> Bool
noMaybeLabel = maybe True noLabel

instance Arbitrary (PairView (Term TermPrim)) where
arbitrary = PairView <$> arbitrary
Expand Down Expand Up @@ -427,8 +424,8 @@ instance Arbitrary P_Population where
arbitrary =
oneof
[ P_RelPopu
<$> arbitrary `suchThat` noOne
<*> arbitrary `suchThat` noOne
<$> arbitrary `suchThat` notMaybeIsOneAndNoLabel
<*> arbitrary `suchThat` notMaybeIsOneAndNoLabel
<*> arbitrary
<*> arbitrary
<*> arbitrary,
Expand Down Expand Up @@ -585,6 +582,12 @@ notIsOneAndnoLabel cpt = case cpt of
PCpt _ lbl -> isNothing lbl
P_ONE -> False

noMaybeLabel :: Maybe P_Concept -> Bool
noMaybeLabel = maybe True noLabel

notMaybeIsOneAndNoLabel :: Maybe P_Concept -> Bool
notMaybeIsOneAndNoLabel = maybe False notIsOneAndnoLabel

safePlainName :: Gen Text1
safePlainName =
oneof
Expand Down

0 comments on commit a079534

Please sign in to comment.