diff options
author | Daniel Firth <locallycompact@gmail.com> | 2018-06-29 14:13:32 +0100 |
---|---|---|
committer | Daniel Firth <locallycompact@gmail.com> | 2018-07-04 09:50:15 +0100 |
commit | f65e14048c76a1eeb7d6ac5c9ac9c741b4d9df14 (patch) | |
tree | 86ca8fc011b1050e1241910230d9216a4286a3a7 | |
parent | 758a01a426f1912395d1d1f1d0fd1506910842c1 (diff) |
Fix hlint errors in Test
-rw-r--r-- | Test/PcapCrash.hs | 3 | ||||
-rw-r--r-- | Test/Regions.hs | 15 |
2 files changed, 8 insertions, 10 deletions
diff --git a/Test/PcapCrash.hs b/Test/PcapCrash.hs index e28a69c..4d03ae1 100644 --- a/Test/PcapCrash.hs +++ b/Test/PcapCrash.hs @@ -17,5 +17,4 @@ main = do exitFailure -- TODO: check there are no warnings (but there are because we don't -- understand 'h', so we just skip it) - Right _ -> do - return () + Right _ -> return () diff --git a/Test/Regions.hs b/Test/Regions.hs index d4b46b0..c14e976 100644 --- a/Test/Regions.hs +++ b/Test/Regions.hs @@ -15,7 +15,7 @@ newtype NonOverlappingStripes = NonOverlappingStripes [Stripe] instance Arbitrary NonOverlappingStripes where arbitrary = do -- listOf2 - tops <- sort <$> ((:) <$> arbitrary <*> (listOf1 arbitrary)) + tops <- sort <$> ((:) <$> arbitrary <*> listOf1 arbitrary) -- Generate dense stripes sometimes let g :: Gen Double @@ -37,7 +37,7 @@ instance (Eq a, Arbitrary a) => Arbitrary (ValidRegions a) where values <- vector (length stripes) `suchThat` unique return $ ValidRegions (zip stripes values) where - unique xs = all (== 1) . map length . group $ xs + unique = all (== 1) . map length . group instance (Eq a, Arbitrary a) => Arbitrary (RegionSelection a) where arbitrary = do @@ -46,8 +46,8 @@ instance (Eq a, Arbitrary a) => Arbitrary (RegionSelection a) where prop_NonOverlapping_generator_works (NonOverlappingStripes ss) = nonOverlapping ss -prop_InitiallyUnselected = \rs -> isNothing $ rsCurrent rs -prop_UpDoesNothing = \rs -> isNothing $ rsCurrent $ regionSelectionUp rs +prop_InitiallyUnselected rs = isNothing $ rsCurrent rs +prop_UpDoesNothing rs = isNothing $ rsCurrent $ regionSelectionUp rs prop_DownDoesNothing vr@(ValidRegions regions) = withRegions vr $ \rs -> @@ -130,11 +130,10 @@ randomMutation = do ] randomMutations :: Gen (RegionSelection a -> RegionSelection a) -randomMutations = do - fs <- listOf randomMutation - return $ foldr (.) id fs +randomMutations = + foldr (.) id <$> listOf randomMutation -prop_ClickAlwaysInSelection = \rs -> +prop_ClickAlwaysInSelection rs = forAll (fmap Blind randomMutations) $ \(Blind f) -> let rs' = f rs |