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


The following commit has been merged in the master branch:
commit a4fa20bdde9f1c72f7d56a99e8befbad40e9ee13
Author: John Goerzen <jgoerzen at complete.org>
Date:   Mon Nov 15 09:39:16 2004 +0100

    Checkpointing
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-44)

diff --git a/ChangeLog b/ChangeLog
index 20de341..f754044 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-15 02:39:16 GMT	John Goerzen <jgoerzen at complete.org>	patch-44
+
+    Summary:
+      Checkpointing
+    Revision:
+      missingh--head--0.5--patch-44
+
+
+    modified files:
+     ChangeLog libsrc/MissingH/Printf.hs testsrc/Printftest.hs
+
+
 2004-11-15 02:17:28 GMT	John Goerzen <jgoerzen at complete.org>	patch-43
 
     Summary:
diff --git a/libsrc/MissingH/Printf.hs b/libsrc/MissingH/Printf.hs
index e4e2066..537cfe4 100644
--- a/libsrc/MissingH/Printf.hs
+++ b/libsrc/MissingH/Printf.hs
@@ -92,10 +92,11 @@ sprintf ('%' : xs) (y : ys) =
          Nothing -> error $ "Problem in format string at %" ++ xs
          --Just (_, _, r, x) -> "<" ++ show x ++ ">" ++ sprintf r ys
          Just (_, _, remainder, [flagstr, widthstr, precstr, [fmt]]) ->
-             let width = if widthstr == "" then Nothing else Just (read widthstr)
+             let width = if widthstr == "" then Nothing else Just ((read widthstr)::Width)
                  prec = if precstr == "" then Nothing else Just precstr
                  flags = toflags flagstr
                  in
+                 --(show width) ++ sprintf remainder ys
                  (get_conversion_func fmt y flags width prec) ++ sprintf remainder ys
          _ -> error $ "Problem matching format string at %" ++ xs
 
diff --git a/testsrc/Printftest.hs b/testsrc/Printftest.hs
index 82c8891..9877aad 100644
--- a/testsrc/Printftest.hs
+++ b/testsrc/Printftest.hs
@@ -33,5 +33,12 @@ test_vsprintf =
     "FE" @=? vsprintf "%X" (254::Integer)
     "10" @=? vsprintf "%o" (8::Integer)
 
-tests = TestList [TestLabel "vsprintf" (TestCase test_vsprintf)
+test_vsprintf_strings =
+    do
+    ".     ." @=? vsprintf ".%5s." ""
+    "     " @=? vsprintf "%5s" ""
+    "     " @=? vsprintf "%-5s" ""
+    
+tests = TestList [TestLabel "vsprintf" (TestCase test_vsprintf),
+                  TestLabel "vsprintf strings" (TestCase test_vsprintf_strings)
                  ]
\ No newline at end of file

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list