Skip to content

Commit

Permalink
Less fancy show labeling
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Aug 22, 2023
1 parent 6afe1c7 commit 5b8f513
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions test/ExpiringSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ allOpTypes = ["Insert", "Delete", "Lookup", "Update", "UpdateNothing"]
prop_expMapDoesMapStuff :: [MapOp] -> Property
prop_expMapDoesMapStuff ops =
coverTable "pkt types" ((,5) <$> allOpTypes) $
tabulate "pkt types" (lab <$> ops) $
tabulate "pkt types" (takeWhile (/= ' ') . show <$> ops) $
checkCoverage $
massocs === eassocs
where
lab x = let (s,_) = break (== ' ') . show $ x in s
massocs = snd $ evalRWS (applyOpsM ops) () (mempty :: Map.Map SomeKey Int)
eassocs = snd $ evalRWS (applyOpsE ops) () (ExpiringMap.new 0)

Expand Down
6 changes: 3 additions & 3 deletions test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ prop_PacketRT50 p =
A.Fail{} -> False
(A.Done _ r) -> r == p

where lab x = let (s,_) = break (== ' ') . show $ x in s
where lab = takeWhile (/= ' ') . show

prop_PacketRT311 :: MQTTPkt -> QC.Property
prop_PacketRT311 p = available p ==>
Expand All @@ -86,7 +86,7 @@ prop_PacketRT311 p = available p ==>
(A.Done _ r) -> r == p'

where
lab x = let (s,_) = break (== ' ') . show $ x in s
lab = takeWhile (/= ' ') . show
p' = v311mask p

available (AuthPkt _) = False
Expand All @@ -97,7 +97,7 @@ prop_PropertyRT p = label (lab p) $ case A.parse parseProperty (toByteString Pro
A.Fail{} -> False
(A.Done _ r) -> r == p

where lab x = let (s,_) = break (== ' ') . show $ x in s
where lab = takeWhile (/= ' ') . show

prop_SubOptionsRT :: SubOptions -> Bool
prop_SubOptionsRT o = case A.parse parseSubOptions (toByteString Protocol50 o) of
Expand Down

0 comments on commit 5b8f513

Please sign in to comment.