[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:46:40 UTC 2010


The following commit has been merged in the master branch:
commit 305333b39c3518ee333e2c3d0163db086f0a3ef4
Author: John Goerzen <jgoerzen at complete.org>
Date:   Mon Nov 15 08:34:01 2004 +0100

    Added printf tests
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-41)

diff --git a/ChangeLog b/ChangeLog
index 9164a46..27904d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-15 01:34:01 GMT	John Goerzen <jgoerzen at complete.org>	patch-41
+
+    Summary:
+      Added printf tests
+    Revision:
+      missingh--head--0.5--patch-41
+
+
+    new files:
+     testsrc/Printftest.hs
+
+    modified files:
+     ChangeLog testsrc/Tests.hs
+
+
 2004-11-15 00:21:28 GMT	John Goerzen <jgoerzen at complete.org>	patch-40
 
     Summary:
diff --git a/testsrc/Pathtest.hs b/testsrc/Printftest.hs
similarity index 54%
copy from testsrc/Pathtest.hs
copy to testsrc/Printftest.hs
index 8c2c4a2..1776e09 100644
--- a/testsrc/Pathtest.hs
+++ b/testsrc/Printftest.hs
@@ -1,4 +1,4 @@
-{- arch-tag: Path tests main file
+{- arch-tag: Printf tests main file
 Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
 
 This program is free software; you can redistribute it and/or modify
@@ -16,19 +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 Pathtest(tests) where
+module Printftest(tests) where
 import HUnit
-import MissingH.Path
+import MissingH.Printf
 
-test_splitExt =
-    let f inp exp = exp @=? splitExt inp in
-        do
-        f "" ("", "")
-        f "/usr/local" ("/usr/local", "")
-        f "../foo.txt" ("../foo", ".txt")
-        f "../bar.txt.gz" ("../bar.txt", ".gz")
-        f "foo.txt/bar" ("foo.txt/bar", "")
-        f "foo.txt/bar.bz" ("foo.txt/bar", ".bz")
+test_vsprintf = 
+    do
+    "" @=? vsprintf ""
+    "%" @=? vsprintf "%%"
+    "foo: 5" @=? vsprintf "%s: %d" "foo" (5::Integer)
+    "%foo%:% %-1%\n%" @=? vsprintf "%%%s%%:%% %%%d%%\n%%" "foo" (-1::Integer)
+    "baz: 3.140000" @=? vsprintf "%s: %f" "baz" (3.14::Double)
+    "quux: 3.140000e+02" @=? vsprintf "%s: %e" "quux" (314::Double)
+    "fe" @=? vsprintf "%x" (254::Integer)
+    "FE" @=? vsprintf "%X" (254::Integer)
+    "10" @=? vsprintf "%o" (8::Integer)
 
-tests = TestList [TestLabel "splitExt" (TestCase test_splitExt)
+tests = TestList [TestLabel "vsprintf" (TestCase test_vsprintf)
                  ]
\ No newline at end of file
diff --git a/testsrc/Tests.hs b/testsrc/Tests.hs
index cef9ef6..f05f5c5 100644
--- a/testsrc/Tests.hs
+++ b/testsrc/Tests.hs
@@ -25,6 +25,7 @@ import qualified Pathtest
 import qualified Strtest
 import qualified IOtest
 import qualified Bitstest
+import qualified Printftest
 import qualified Network.FTP.Parsertest
 
 test1 = TestCase ("x" @=? "x")
@@ -36,6 +37,7 @@ tests = TestList [TestLabel "test1" test1,
                  TestLabel "Path" Pathtest.tests,
                  TestLabel "MIMETypes" MIMETypestest.tests,
                  TestLabel "Bitstest" Bitstest.tests,
-                 TestLabel "Network.FTP.Parser" Network.FTP.Parsertest.tests]
+                 TestLabel "Network.FTP.Parser" Network.FTP.Parsertest.tests,
+                 TestLabel "Printftest" Printftest.tests]
 
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list