Skip to content

Commit 9891d03

Browse files
committed
Add deprecation warnings, add formatting for fs-api and fs-sim
1 parent 552897c commit 9891d03

File tree

16 files changed

+265
-5
lines changed

16 files changed

+265
-5
lines changed

fs-sim/src/System/FS/Sim/Error.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ import qualified Data.ByteString as BS
4949
import qualified Data.ByteString.Char8 as C8
5050
import qualified Data.ByteString.Lazy as BL
5151
import qualified Data.ByteString.Lazy.Char8 as LC8
52-
import Data.Foldable (for_)
53-
import qualified Data.List as List
52+
import Data.Foldable (for_)
5453
import Data.List (dropWhileEnd, intercalate)
54+
import qualified Data.List as List
5555
import Data.Maybe (catMaybes, isNothing)
5656
import Data.String (IsString (..))
5757
import Data.Word (Word64)

ouroboros-consensus-test/ouroboros-consensus-test.cabal

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,19 @@ library
3535
Test.ThreadNet.Util.NodeTopology
3636
Test.ThreadNet.Util.Seed
3737

38+
Test.Util.Blob
3839
Test.Util.BoolProps
3940
Test.Util.ChainDB
4041
Test.Util.ChainUpdates
4142
Test.Util.ChunkInfo
4243
Test.Util.Classify
4344
Test.Util.Corruption
4445
Test.Util.FileLock
46+
Test.Util.FS.Sim.Error
47+
Test.Util.FS.Sim.FsTree
48+
Test.Util.FS.Sim.MockFS
49+
Test.Util.FS.Sim.Pure
50+
Test.Util.FS.Sim.STM
4551
Test.Util.HardFork.Future
4652
Test.Util.HardFork.OracularClock
4753
Test.Util.InvertedMap
@@ -255,7 +261,6 @@ test-suite test-storage
255261
, cborg
256262
, containers
257263
, contra-tracer
258-
, directory
259264
, generics-sop
260265
, hashable
261266
, mtl
@@ -268,7 +273,6 @@ test-suite test-storage
268273
, tasty
269274
, tasty-hunit
270275
, tasty-quickcheck
271-
, temporary
272276
, text
273277
, time
274278
, tree-diff
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module Test.Util.Blob {-# DEPRECATED "Use System.FS.Sim.Error instead" #-} (
2+
Blob (..)
3+
, blobFromBS
4+
, blobToBS
5+
) where
6+
7+
import System.FS.Sim.Error
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module Test.Util.FS.Sim.Error {-# DEPRECATED "Use System.FS.Sim.Error from fs-sim" #-} (
2+
-- * Simulate Errors monad
3+
mkSimErrorHasFS
4+
, runSimErrorFS
5+
, withErrors
6+
-- * Streams
7+
, ErrorStream
8+
, ErrorStreamGetSome
9+
, ErrorStreamPutSome
10+
, Stream (..)
11+
, always
12+
, mkStream
13+
, mkStreamGen
14+
, null
15+
, runStream
16+
-- * Generating partial reads/writes
17+
, Partial (..)
18+
, hGetSomePartial
19+
, hPutSomePartial
20+
-- * Generating corruption for 'hPutSome'
21+
, PutCorruption (..)
22+
, corrupt
23+
-- * Error streams for 'HasFS'
24+
, Errors (..)
25+
, allNull
26+
, genErrors
27+
, simpleErrors
28+
) where
29+
30+
import Prelude hiding (null)
31+
32+
import System.FS.Sim.Error
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module Test.Util.FS.Sim.FsTree {-# DEPRECATED "Use System.FS.Sim.FsTree from fs-sim" #-} (
2+
-- * FsTree type and indexing functions
3+
FsTree (..)
4+
, FsTreeError (..)
5+
, example
6+
-- * Construction
7+
, empty
8+
-- * Indexing
9+
, getDir
10+
, getFile
11+
, index
12+
-- * File system operations
13+
, createDirIfMissing
14+
, createDirWithParents
15+
, openFile
16+
, removeFile
17+
, renameFile
18+
, replace
19+
-- * Pretty-printing
20+
, pretty
21+
) where
22+
23+
import System.FS.Sim.FsTree
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module Test.Util.FS.Sim.MockFS {-# DEPRECATED "Use System.FS.Sim.MockFS from fs-sim" #-} (
2+
empty
3+
, example
4+
, handleIsOpen
5+
, numOpenHandles
6+
, pretty
7+
-- * Debugging
8+
, dumpState
9+
-- * Operations on files
10+
, hClose
11+
, hGetSize
12+
, hGetSome
13+
, hGetSomeAt
14+
, hIsOpen
15+
, hOpen
16+
, hPutSome
17+
, hSeek
18+
, hTruncate
19+
-- * Operations on directories
20+
, createDirectory
21+
, createDirectoryIfMissing
22+
, doesDirectoryExist
23+
, doesFileExist
24+
, listDirectory
25+
, removeFile
26+
, renameFile
27+
-- * Exported for the benefit of tests only
28+
, Files
29+
, mockFiles
30+
-- ** opaque
31+
, ClosedHandleState
32+
, FilePtr
33+
, HandleState
34+
, OpenHandleState
35+
-- * opaque
36+
, HandleMock
37+
, MockFS
38+
) where
39+
40+
import System.FS.Sim.MockFS
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Test.Util.FS.Sim.Pure {-# DEPRECATED "Use System.FS.Sim.Pure from fs-sim" #-}(
2+
PureSimFS
3+
-- opaque
4+
, pureHasFS
5+
, runPureSimFS
6+
) where
7+
8+
import System.FS.Sim.Pure
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Test.Util.FS.Sim.STM {-# DEPRECATED "Use System.FS.Sim.STM from fs-sim" #-} (
2+
runSimFS
3+
, simHasFS
4+
) where
5+
6+
import System.FS.Sim.STM

ouroboros-consensus/ouroboros-consensus.cabal

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ library
200200
Ouroboros.Consensus.Storage.ChainDB.Impl.Types
201201
Ouroboros.Consensus.Storage.ChainDB.Init
202202
Ouroboros.Consensus.Storage.Common
203+
Ouroboros.Consensus.Storage.FS.API
204+
Ouroboros.Consensus.Storage.FS.API.Types
205+
Ouroboros.Consensus.Storage.FS.CRC
206+
Ouroboros.Consensus.Storage.FS.Handle
207+
Ouroboros.Consensus.Storage.FS.IO
208+
Ouroboros.Consensus.Storage.IO
203209
Ouroboros.Consensus.Storage.ImmutableDB
204210
Ouroboros.Consensus.Storage.ImmutableDB.API
205211
Ouroboros.Consensus.Storage.ImmutableDB.Chunks
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module Ouroboros.Consensus.Storage.FS.API {-# DEPRECATED "Use System.FS.API from fs-api" #-} (
2+
Handle (..)
3+
, HasFS (..)
4+
, SomeHasFS (..)
5+
, hClose'
6+
, hGetAll
7+
, hGetAllAt
8+
, hGetExactly
9+
, hGetExactlyAt
10+
, hPut
11+
, hPutAll
12+
, hPutAllStrict
13+
, withFile
14+
) where
15+
16+
import System.FS.API

0 commit comments

Comments
 (0)