In-memory Handle for testing

For testing I want to stub handles, performing all reads and writes in memory (and in process, so no mmap). From looking at the documentation of mkFileHandle[1], I think this should be possible. But it requires some work. Is there already something out there? Cheers, Simon [1] http://hackage.haskell.org/packages/archive/base/4.4.1.0/doc/html/GHC-IO-Han...

On Fri, Jan 20, 2012 at 5:53 AM, Simon Hengel
For testing I want to stub handles, performing all reads and writes in memory (and in process, so no mmap). From looking at the documentation of mkFileHandle[1], I think this should be possible. But it requires some work. Is there already something out there?
John Miliken has one on Hackage: http://hackage.haskell.org/package/knob I had a read-only version that I used for testing things a ways back: http://hackage.haskell.org/trac/ghc/attachment/ticket/4144/ByteStringHandle.... There might still be some things in GHC.IO.Handle that assume FD handles - I haven't tried it in a while. Antoine
participants (2)
-
Antoine Latter
-
Simon Hengel