-
Notifications
You must be signed in to change notification settings - Fork 1
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
Nate Soares
committed
Apr 7, 2012
1 parent
49de3bd
commit 4141467
Showing
2 changed files
with
18 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
module Properties.Pair where | ||
import Pair | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
module Test.Data.Pair where | ||
import Data.Pair | ||
import Test.Framework | ||
import Test.Framework.Providers.QuickCheck2 | ||
import Test.QuickCheck | ||
|
||
propInversion :: (Eq (p a b), Pair p) => p a b -> Bool | ||
propInversion p = p == fromTuple (toTuple p) | ||
testPair :: forall p a b. | ||
( Eq (p a b) | ||
, Show (p a b) | ||
, Arbitrary (p a b) | ||
, Pair p) => p a b -> Test | ||
testPair _ = testGroup "pair" | ||
[ testProperty "indempotence" (\(p::p a b) -> fromTuple (toTuple p) == p) | ||
, testProperty "rebuild" (\(p::p a b) -> build (left p) (right p) == p) | ||
] |
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