Fix build on GHC 8.2

This commit is contained in:
Taylor Fausak 2022-09-09 19:44:12 +00:00
parent b970a11851
commit 0b89665b44
3 changed files with 5 additions and 6 deletions

View File

@ -1,4 +1,3 @@
- group: { name: dollar, enabled: true }
- group: { name: generalise, enabled: true }
- ignore: { name: Use lambda-case }
- ignore: { name: Use tuple-section }

View File

@ -2098,14 +2098,14 @@ shouldBe :: (Stack.HasCallStack, Eq a, Show a) => a -> a -> HUnit.Assertion
shouldBe = (HUnit.@?=)
shouldSatisfy :: (Stack.HasCallStack, Show a) => a -> (a -> Bool) -> HUnit.Assertion
shouldSatisfy value predicate = HUnit.assertBool ("predicate failed on: " <> show value) $ predicate value
shouldSatisfy value predicate = HUnit.assertBool ("predicate failed on: " ++ show value) $ predicate value
shouldThrow :: (Stack.HasCallStack, Exception.Exception e) => IO a -> Selector e -> HUnit.Assertion
shouldThrow action predicate = do
result <- Exception.try action
case result of
Right _ -> HUnit.assertFailure "did not get expected exception"
Left exception -> HUnit.assertBool ("predicate failed on expected exception: " <> show exception) $ predicate exception
Left exception -> HUnit.assertBool ("predicate failed on expected exception: " ++ show exception) $ predicate exception
specToTest :: Stack.HasCallStack => Spec -> HUnit.Test
specToTest = HUnit.TestList . Foldable.toList . Writer.execWriter

View File

@ -23,7 +23,7 @@ flag pedantic
common library
build-depends:
, base >= 4.10.0 && < 4.18
, base >= 4.10 && < 4.18
, bytestring >= 0.10.8 && < 0.12
, containers >= 0.5.10 && < 0.7
, text >= 1.2.3 && < 1.3 || >= 2.0 && < 2.1
@ -72,7 +72,7 @@ library
import: library
build-depends:
, template-haskell >= 2.12.0 && < 2.20
, template-haskell >= 2.12 && < 2.20
exposed-modules:
Witch
Witch.From
@ -95,7 +95,7 @@ test-suite witch-test-suite
build-depends:
, HUnit >= 1.6.1 && < 1.7
, transformers
, transformers >= 0.5.2 && < 0.7
hs-source-dirs: source/test-suite
main-is: Main.hs
type: exitcode-stdio-1.0