HUnit-approx 1.1 → 1.1.1
raw patch · 4 files changed
+28/−13 lines, 4 filesdep +call-stackPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: call-stack
API changes (from Hackage documentation)
- Test.HUnit.Approx: (@?~) :: (Ord a, Num a, Show a, ?epsilon :: a) => a -> a -> Assertion
+ Test.HUnit.Approx: (@?~) :: (HasCallStack, Ord a, Num a, Show a, ?epsilon :: a) => a -> a -> Assertion
- Test.HUnit.Approx: (@~?) :: (Ord a, Num a, Show a, ?epsilon :: a) => a -> a -> Assertion
+ Test.HUnit.Approx: (@~?) :: (HasCallStack, Ord a, Num a, Show a, ?epsilon :: a) => a -> a -> Assertion
- Test.HUnit.Approx: (~?~) :: (Ord a, Num a, Show a, ?epsilon :: a) => a -> a -> Test
+ Test.HUnit.Approx: (~?~) :: (HasCallStack, Ord a, Num a, Show a, ?epsilon :: a) => a -> a -> Test
- Test.HUnit.Approx: (~~?) :: (Ord a, Num a, Show a, ?epsilon :: a) => a -> a -> Test
+ Test.HUnit.Approx: (~~?) :: (HasCallStack, Ord a, Num a, Show a, ?epsilon :: a) => a -> a -> Test
- Test.HUnit.Approx: assertApproxEqual :: (Ord a, Num a, Show a) => String -> a -> a -> a -> Assertion
+ Test.HUnit.Approx: assertApproxEqual :: (HasCallStack, Ord a, Num a, Show a) => String -> a -> a -> a -> Assertion
Files
- CHANGES.md +10/−0
- HUnit-approx.cabal +9/−5
- Test/HUnit/Approx.hs +7/−6
- Tests/Main.hs +2/−2
CHANGES.md view
@@ -1,6 +1,16 @@ `HUnit-approx` changelog ======================== +1.1.1+-----++* Use `HasCallStack` to provide better locations for errors.++1.1.0.1+-------++* Remove `-main-is` for compatibility with cabal 2.0.+ 1.1 ---
HUnit-approx.cabal view
@@ -1,17 +1,19 @@ name: HUnit-approx-version: 1.1+version: 1.1.1 cabal-version: >= 1.10 synopsis: Approximate equality for floating point numbers with HUnit homepage: https://github.com/goldfirere/HUnit-approx category: Testing-author: Richard Eisenberg <eir@cis.upenn.edu>-maintainer: Richard Eisenberg <eir@cis.upenn.edu>+author: Richard Eisenberg <rae@cs.brynmawr.edu>+maintainer: Richard Eisenberg <rae@cs.brynmawr.edu> bug-reports: https://github.com/goldfirere/HUnit-approx/issues stability: intended to be stable extra-source-files: README.md, CHANGES.md license: BSD3 license-file: LICENSE build-type: Simple+tested-with: GHC == 7.0.4, GHC == 7.2.2, GHC == 7.4.2, GHC == 7.6.3,+ GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.1 description: This package exports combinators useful in comparing floating-point numbers in HUnit tests, by using approximate equality.@@ -19,18 +21,19 @@ source-repository this type: git location: https://github.com/goldfirere/HUnit-approx.git- tag: v1.1+ tag: v1.1.1 library build-depends: base == 4.* , HUnit >= 1.2+ , call-stack >= 0.1 exposed-modules: Test.HUnit.Approx default-language: Haskell2010 test-suite sanity-check type: exitcode-stdio-1.0- ghc-options: -Wall -main-is Tests.Main+ ghc-options: -Wall default-language: Haskell2010 main-is: Tests/Main.hs @@ -38,4 +41,5 @@ base == 4.* , HUnit >= 1.2 , HUnit-approx+ , call-stack >= 0.1
Test/HUnit/Approx.hs view
@@ -7,7 +7,7 @@ -- Module : Test.HUnit.Approx -- Copyright : (C) 2014 Richard Eisenberg -- License : BSD-style (see LICENSE)--- Maintainer : Richard Eisenberg (eir@cis.upenn.edu)+-- Maintainer : Richard Eisenberg (rae@cs.brynmawr.edu) -- Stability : intended to be stable -- Portability : not portable (uses implicit parameters) --@@ -25,6 +25,7 @@ import Test.HUnit import Control.Monad ( unless )+import Data.CallStack -- | Asserts that the specified actual value is approximately equal to the -- expected value. The output message will contain the prefix, the expected@@ -32,7 +33,7 @@ -- -- If the prefix is the empty string (i.e., @\"\"@), then the prefix is omitted -- and only the expected and actual values are output.-assertApproxEqual :: (Ord a, Num a, Show a)+assertApproxEqual :: (HasCallStack, Ord a, Num a, Show a) => String -- ^ The message prefix -> a -- ^ Maximum allowable margin of error -> a -- ^ The expected value@@ -47,7 +48,7 @@ -- | Asserts that the specified actual value is approximately equal to the -- expected value (with the expected value on the right-hand side). The margin -- of error is specified with the implicit parameter @epsilon@.-(@?~) :: (Ord a, Num a, Show a, ?epsilon :: a)+(@?~) :: (HasCallStack, Ord a, Num a, Show a, ?epsilon :: a) => a -- ^ The actual value -> a -- ^ The expected value -> Assertion@@ -57,7 +58,7 @@ -- | Asserts that the specified actual value is approximately equal to the -- expected value (with the expected value on the left-hand side). The margin -- of error is specified with the implicit parameter @epsilon@.-(@~?) :: (Ord a, Num a, Show a, ?epsilon :: a)+(@~?) :: (HasCallStack, Ord a, Num a, Show a, ?epsilon :: a) => a -- ^ The expected value -> a -- ^ The actual value -> Assertion@@ -67,7 +68,7 @@ -- | Shorthand for a test case that asserts approximate equality (with the -- expected value on the left-hand side, and the actual value on the -- right-hand side).-(~~?) :: (Ord a, Num a, Show a, ?epsilon :: a)+(~~?) :: (HasCallStack, Ord a, Num a, Show a, ?epsilon :: a) => a -- ^ The expected value -> a -- ^ The actual value -> Test@@ -77,7 +78,7 @@ -- | Shorthand for a test case that asserts approximate equality (with the -- actual value on the left-hand side, and the expected value on the -- right-hand side).-(~?~) :: (Ord a, Num a, Show a, ?epsilon :: a)+(~?~) :: (HasCallStack, Ord a, Num a, Show a, ?epsilon :: a) => a -- ^ The actual value -> a -- ^ The expected value -> Test
Tests/Main.hs view
@@ -1,14 +1,14 @@ {- Tests for the HUnit-approx package Copyright (c) 2014 Richard Eisenberg- eir@cis.upenn.edu+ rae@cs.brynmawr.edu -} {-# LANGUAGE ImplicitParams, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} -module Tests.Main where+module Main where import Test.HUnit import Test.HUnit.Approx