rematch 0.1.2.1 → 0.2.0.0
raw patch · 4 files changed
+12/−43 lines, 4 filesdep +hspecdep −QuickCheckdep ~HUnit
Dependencies added: hspec
Dependencies removed: QuickCheck
Dependency ranges changed: HUnit
Files
- Control/Rematch.hs +0/−16
- Control/Rematch/QuickCheck.hs +0/−23
- Main.hs +4/−0
- rematch.cabal +8/−4
Control/Rematch.hs view
@@ -6,7 +6,6 @@ module Control.Rematch( Matcher(..) -- ** Useful functions for running matchers- , expect , runMatch -- ** Basic Matchers , is@@ -40,7 +39,6 @@ , matchList , standardMismatch ) where-import Test.HUnit(Assertion, assertFailure) import qualified Data.Maybe as M import Control.Rematch.Run import Control.Rematch.Formatting@@ -54,20 +52,6 @@ , describeMismatch :: a -> String -- ^ A description to be shown if the match fails. }---- |Run a matcher as an HUnit assertion------ Example output:------ @---Expected: equalTo "a"--- but: was "b"--- @-expect :: a -> Matcher a -> Assertion-expect a matcher = case res of- MatchSuccess -> return ()- (MatchFailure msg) -> assertFailure msg- where res = runMatch matcher a -- |Inverts a matcher, so success becomes failure, and failure -- becomes success
− Control/Rematch/QuickCheck.hs
@@ -1,23 +0,0 @@-module Control.Rematch.QuickCheck where-import Test.QuickCheck.Property-import Control.Rematch-import Control.Rematch.Run---- |Run a matcher as an QuickCheck assertion------ Example output:------ @---Expected: equalTo "a"--- but: was "b"--- @-expectP :: a -> Matcher a -> Property-expectP a matcher = property $ (runMatch matcher a)--instance Testable Match where- property = property . liftMatchResult- exhaustive = const True--liftMatchResult :: Match -> Result-liftMatchResult MatchSuccess = succeeded-liftMatchResult (MatchFailure mismatch) = failed { reason = mismatch }
+ Main.hs view
@@ -0,0 +1,4 @@+import qualified Control.Rematch.Specs as S++main :: IO ()+main = S.main
rematch.cabal view
@@ -1,8 +1,8 @@--- Initial rematch.cabal generated by cabal init. For further +-- Initial rematch.cabal generated by cabal init. For further -- documentation, see http://haskell.org/cabal/users-guide/ name: rematch-version: 0.1.2.1+version: 0.2.0.0 synopsis: A simple api for matchers description: Rematch is a simple library of matchers, which express rules@@ -26,5 +26,9 @@ cabal-version: >=1.8 library- exposed-modules: Control.Rematch, Control.Rematch.Formatting, Control.Rematch.Run, Control.Rematch.QuickCheck- build-depends: base >= 4.5.0 && < 5, HUnit >= 1.0, QuickCheck >= 2.0+ exposed-modules: Control.Rematch, Control.Rematch.Formatting, Control.Rematch.Run+ build-depends: base >= 4.5.0 && < 5+test-suite tests+ build-depends: base >= 4.5.0 && < 5, hspec >= 1.4, HUnit >= 1.2+ type: exitcode-stdio-1.0+ main-is: Main.hs