Commits

Bryan O'Sullivan committed 032e258

Add simple QuickCheck tests

Comments (0)

Files changed (3)

-^(?:cabal-dev|dist)$
+^(?:cabal-dev|dist|tests/dist)$
 ^demo/demo$
 \.(?:aux|eventlog|h[ip]|log|[oa]|orig|prof|ps|rej|swp)$
 ~$

tests/Properties.hs

+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
+       ]

tests/double-conversion-tests.cabal

+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