[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 14:57:02 UTC 2010


The following commit has been merged in the master branch:
commit e5c985951aafe7b1865dd395858ea240e3cb05f6
Author: John Goerzen <jgoerzen at complete.org>
Date:   Sat Apr 16 10:13:34 2005 +0100

    Added Cmdtest

diff --git a/MissingH/Cmd.hs b/MissingH/Cmd.hs
index 791f538..f472756 100644
--- a/MissingH/Cmd.hs
+++ b/MissingH/Cmd.hs
@@ -101,7 +101,7 @@ pOpen :: PipeMode -> FilePath -> [String] ->
 pOpen pm fp args func =
         do
         pipepair <- createPipe
-        debugM (logbase ++ ".pOpen3")
+        debugM (logbase ++ ".pOpen")
                ("Running: " ++ fp ++ " " ++ (show args))
         case pm of
          ReadFromPipe -> do
diff --git a/TODO b/TODO
index c3e8431..46e5736 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,7 @@
 arch-tag: TODO file
 
+Cmd: pOpenBoth -- read and write, use forkIO for one of them
+
 Printf:
  make %H work 
 
diff --git a/testsrc/IOtest.hs b/testsrc/Cmdtest.hs
similarity index 56%
copy from testsrc/IOtest.hs
copy to testsrc/Cmdtest.hs
index 18a635b..d095931 100644
--- a/testsrc/IOtest.hs
+++ b/testsrc/Cmdtest.hs
@@ -1,5 +1,5 @@
-{- arch-tag: IO tests main file
-Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
+{- 
+Copyright (C) 2005 John Goerzen <jgoerzen at complete.org>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -16,13 +16,21 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -}
 
-module IOtest() where
+module Cmdtest(tests) where
 import HUnit
-import MissingH.IO
-import Testutil
-
-
-
-
+import MissingH.Cmd
+import System.IO
+
+test_pOpen_Read = 
+    let f cmd args result = TestLabel (cmd ++ " " ++ show args) $ TestCase $
+                            do x <- pOpen ReadFromPipe cmd args rf
+                               result @=? x
+        rf h = do c <- hGetContents h
+                  seq c (return c)
+        in [
+            f "echo" ["Hello."] "Hello\n"
+           ]
+
+tests = TestList [TestLabel "read" (TestList test_pOpen_Read)]
 
 
diff --git a/testsrc/Tests.hs b/testsrc/Tests.hs
index 2b96aea..5237f9a 100644
--- a/testsrc/Tests.hs
+++ b/testsrc/Tests.hs
@@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 module Tests(tests) where
 import HUnit
+import qualified Cmdtest
 import qualified MIMETypestest
 import qualified Listtest
 import qualified FiniteMaptest

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list