Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Jan 19, 2021
1 parent 102e13e commit bef2456
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions tests/HUnitTestExtended.hs
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
{-# LANGUAGE CPP #-}
module HUnitTestExtended (
extendedTests
) where
module HUnitTestExtended (extendedTests) where

import Test.HUnit
import HUnitTestBase

#if MIN_VERSION_base(4,9,0)
errorCall :: a
errorCall = error "error"
#endif

extendedTests :: Test
extendedTests = test [

-- Hugs doesn't currently catch arithmetic exceptions.

"div by 0" ~:
expectUnspecifiedError (TestCase ((3 `div` 0 :: Integer) `seq` return ())),
expectError "divide by zero" (TestCase ((3 `div` 0 :: Integer) `seq` return ())),

"list ref out of bounds" ~:
expectUnspecifiedError (TestCase ([1 .. 4 :: Integer] !! 10 `seq` return ())),

#if MIN_VERSION_base(4,9,0)
"error" ~:
expectError "error\nCallStack (from HasCallStack):\n error, called at tests/HUnitTestExtended.hs:11:13 in main:HUnitTestExtended" (TestCase errorCall),
#else
"error" ~:
expectError "error" (TestCase (error "error")),
#endif
expectUnspecifiedError (TestCase (error "error")),

"tail []" ~:
expectUnspecifiedError (TestCase (tail [] `seq` return ()))
Expand Down

0 comments on commit bef2456

Please sign in to comment.