Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- | | ||
-- Copyright: © 2018-2021 IOHK | ||
-- License: Apache-2.0 | ||
-- | ||
-- Utility function for making test suites pass on Darwin/macOS. | ||
|
||
module Test.Utils.Darwin | ||
( pendingOnMacOS | ||
) where | ||
|
||
import Prelude | ||
|
||
import Control.Monad | ||
( when ) | ||
import System.Info | ||
( os ) | ||
import Test.Hspec.Core.Spec | ||
( pendingWith ) | ||
import Test.Hspec.Expectations | ||
( Expectation, HasCallStack ) | ||
|
||
-- | Mark test pending if running on macOS | ||
pendingOnMacOS :: HasCallStack => String -> Expectation | ||
pendingOnMacOS reason = when isDarwin $ pendingWith reason | ||
|
||
isDarwin :: Bool | ||
isDarwin = os == "darwin" |