[commit: packages/time] master: added Test.Tests and Test.TestUtil modules (46ce767)

git at git.haskell.org git at git.haskell.org
Fri Jan 23 23:00:48 UTC 2015


Repository : ssh://git@git.haskell.org/time

On branch  : master
Link       : http://git.haskell.org/packages/time.git/commitdiff/46ce76714c2a83d851a644a170ac958673aaa86c

>---------------------------------------------------------------

commit 46ce76714c2a83d851a644a170ac958673aaa86c
Author: blackredtree <blackredtree at gmail.com>
Date:   Thu Sep 20 15:41:04 2012 -0700

    added Test.Tests and Test.TestUtil modules
    
    Ignore-this: d5fe357080d6ed4f83e2272ad789bbb3
    
    darcs-hash:20120920224104-08fed-3afdeb091b1fab883b255c1be18af368c103dd2c


>---------------------------------------------------------------

46ce76714c2a83d851a644a170ac958673aaa86c
 Test/TestUtil.hs | 43 +++++++++++++++++++++++++++++++++++++++++++
 Test/Tests.hs    | 26 ++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/Test/TestUtil.hs b/Test/TestUtil.hs
new file mode 100644
index 0000000..237bcfb
--- /dev/null
+++ b/Test/TestUtil.hs
@@ -0,0 +1,43 @@
+module Test.TestUtil
+  ( SimpleTest(..)
+  , IO_SimpleTest(..)
+  , diff
+  , module Distribution.TestSuite )
+ where
+
+import Distribution.TestSuite
+
+import System.Cmd
+import System.Exit
+
+--
+
+data SimpleTest = SimpleTest String Result
+
+instance TestOptions SimpleTest where
+  name (SimpleTest s _) = s
+  options = const []
+  defaultOptions _ = return $ Options []
+  check _ _ = []
+  
+instance PureTestable SimpleTest where
+  run (SimpleTest _ r) _ = r
+
+--
+
+data IO_SimpleTest = IO_SimpleTest String (IO Result)
+
+instance TestOptions IO_SimpleTest where
+  name (IO_SimpleTest s _) = s
+  options = const []
+  defaultOptions _ = return $ Options []
+  check _ _ = []
+
+instance ImpureTestable IO_SimpleTest where
+  runM (IO_SimpleTest _ r) _ = r
+
+--
+
+diff :: String -> String -> Result
+diff s t
+  = if s == t then Pass else Fail ""
diff --git a/Test/Tests.hs b/Test/Tests.hs
new file mode 100644
index 0000000..d8e1cb2
--- /dev/null
+++ b/Test/Tests.hs
@@ -0,0 +1,26 @@
+module Test.Tests where
+
+import Distribution.TestSuite
+
+import Test.AddDays
+import Test.ClipDates
+import Test.ConvertBack
+import Test.LongWeekYears
+import Test.TestCalendars
+import Test.TestEaster
+import Test.TestFormat
+import Test.TestMonthDay
+import Test.TestParseDAT
+import Test.TestTime
+
+tests :: [Test]
+tests = [ addDaysTest
+        , clipDates
+        , convertBack
+        , longWeekYears
+        , testCalendars
+        , testEaster
+        , testFormat
+        , testMonthDay
+        , testParseDAT
+        , testTime ]



More information about the ghc-commits mailing list