Skip to content

Commit

Permalink
Add simple QuickCheck tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bos committed Jun 27, 2011
1 parent 49de59b commit 7c4c885
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .hgignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^(?:cabal-dev|dist)$
^(?:cabal-dev|dist|tests/dist)$
^demo/demo$
\.(?:aux|eventlog|h[ip]|log|[oa]|orig|prof|ps|rej|swp)$
~$
Expand Down
11 changes: 11 additions & 0 deletions tests/Properties.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Data.Double.Conversion
import Test.QuickCheck
import Test.Framework (defaultMain, testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
import qualified Data.Text as T

shortest a = (read . T.unpack . toShortest) a == a

main = defaultMain [
testProperty "shortest" shortest
]
15 changes: 15 additions & 0 deletions tests/double-conversion-tests.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: double-conversion-tests
version: 0
cabal-version: >= 1.8
build-type: Simple

executable qc
main-is: Properties.hs

build-depends:
QuickCheck,
base,
double-conversion,
test-framework,
test-framework-quickcheck2,
text >= 0.11.0.8

0 comments on commit 7c4c885

Please sign in to comment.