From c43acccbabc02464a6b02bd191199dd0ccd47b52 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 8 Apr 2024 10:06:38 -0400 Subject: Skip tests that require network This started failing recently, I think because my key expired or something. Anyway I shouldn't be doing network requests in unit tests. So until I figure out how to design a test suite that can handle network requests in a sensible way, just skip these tests. --- Biz/Test.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Biz/Test.hs') diff --git a/Biz/Test.hs b/Biz/Test.hs index 0a2cf2f..508703b 100644 --- a/Biz/Test.hs +++ b/Biz/Test.hs @@ -2,6 +2,8 @@ module Biz.Test ( Tree, + Description, + Assertion, run, group, none, @@ -24,6 +26,10 @@ import qualified Test.Tasty.Runners as Tasty type Tree = Tasty.TestTree +type Description = Tasty.TestName + +type Assertion = HUnit.Assertion + run :: Tree -> IO () run tree = do Tasty.installSignalHandlers @@ -33,16 +39,16 @@ run tree = do exitFailure Just act -> act +> \ok -> if ok then exitSuccess else exitFailure -group :: Tasty.TestName -> [Tasty.TestTree] -> Tasty.TestTree +group :: Description -> [Tasty.TestTree] -> Tree group = Tasty.testGroup -unit :: Tasty.TestName -> HUnit.Assertion -> Tasty.TestTree +unit :: Description -> Assertion -> Tree unit = HUnit.testCase -prop :: QuickCheck.Testable a => Tasty.TestName -> a -> Tasty.TestTree +prop :: QuickCheck.Testable a => Description -> a -> Tree prop = QuickCheck.testProperty -assertFailure :: String -> HUnit.Assertion +assertFailure :: String -> Assertion assertFailure = HUnit.assertFailure with :: -- cgit v1.2.3