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


The following commit has been merged in the master branch:
commit 26d5062d4bfa205323b616379b0c0714800fcace
Author: John Goerzen <jgoerzen at complete.org>
Date:   Tue Dec 21 04:59:05 2004 +0100

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

diff --git a/ChangeLog b/ChangeLog
index 487fc07..01810c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,19 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
 #
 
+2004-12-20 21:59:05 GMT	John Goerzen <jgoerzen at complete.org>	patch-113
+
+    Summary:
+      Checkpointing
+    Revision:
+      missingh--head--0.7--patch-113
+
+
+    modified files:
+     ChangeLog libsrc/MissingH/IO/HVFS/InstanceHelpers.hs
+     testsrc/HVFStest.hs
+
+
 2004-12-20 21:41:29 GMT	John Goerzen <jgoerzen at complete.org>	patch-112
 
     Summary:
diff --git a/libsrc/MissingH/IO/HVFS/InstanceHelpers.hs b/libsrc/MissingH/IO/HVFS/InstanceHelpers.hs
index 6536797..f80de32 100644
--- a/libsrc/MissingH/IO/HVFS/InstanceHelpers.hs
+++ b/libsrc/MissingH/IO/HVFS/InstanceHelpers.hs
@@ -158,3 +158,6 @@ instance HVFSOpenable MemoryVFS StreamReader where
                                       "Can't open a directory"
                                       (Just fp)
                 MemoryFile y -> newStreamReader y
+    vOpen x fp _ = vRaiseError x permissionErrorType
+                     "Only ReadMode is supported with MemoryVFS files"
+                     (Just fp)
diff --git a/testsrc/HVFStest.hs b/testsrc/HVFStest.hs
index 7140729..726ec8f 100644
--- a/testsrc/HVFStest.hs
+++ b/testsrc/HVFStest.hs
@@ -41,6 +41,17 @@ testTree = [("test.txt", MemoryFile "line1\nline2\n"),
             )
            ]
 
+test_content = 
+    let f exp fp = TestLabel exp $ TestCase $
+                     do x <- newMemoryVFS testTree
+                        h <- vOpen x fp ReadMode
+                        exp `ioeq` vGetContents h
+        in
+        [
+         f "line1\nline2\n" "test.txt",
+         f "line1\nline2\n" "/test.txt"
+        ]
+
 test_structure =
     let f msg testfunc = TestLabel msg $ TestCase $ do x <- newMemoryVFS testTree
                                                        testfunc x
@@ -60,5 +71,5 @@ test_structure =
                             
 
 tests = TestList [TestLabel "structure" (TestList test_structure)
-
+                 ,TestLabel "content" (TestList test_content)
                  ]
\ No newline at end of file

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list