Skip to content

Commit d2a5bbc

Browse files
committed
feat(issue558): add corruptSnapshot to IsTable
1 parent 2b010ec commit d2a5bbc

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

test/Database/LSMTree/Class.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Database.LSMTree as Types (LookupResult (..), QueryResult (..),
2424
resolveDeserialised)
2525
import qualified Database.LSMTree as R
2626
import Database.LSMTree.Class.Common as Common
27+
import Test.Util.QC (Choice)
2728

2829
-- | Class abstracting over table operations.
2930
--
@@ -140,6 +141,14 @@ class (IsSession (Session h)) => IsTable h where
140141
-> h m k v b
141142
-> m ()
142143

144+
corruptSnapshot ::
145+
( IOLike m
146+
)
147+
=> Choice
148+
-> SnapshotName
149+
-> h m k v b
150+
-> m ()
151+
143152
openSnapshot ::
144153
( IOLike m
145154
, C k v b
@@ -244,6 +253,7 @@ instance IsTable R.Table where
244253
readCursor _ = R.readCursor
245254

246255
createSnapshot = R.createSnapshot
256+
corruptSnapshot = error "TODO: not yet implemented"
247257
openSnapshot sesh snap = R.openSnapshot sesh R.configNoOverride snap
248258

249259
duplicate = R.duplicate

test/Database/LSMTree/Model/IO.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ instance Class.IsTable Table where
8585
runInOpenSession s (Model.readCursor x1 c)
8686

8787
createSnapshot x1 x2 (Table s t) = runInOpenSession s (Model.createSnapshot x1 x2 t)
88+
corruptSnapshot _ x (Table s _t) = runInOpenSession s (Model.corruptSnapshot x)
8889
openSnapshot s x1 x2 = Table s <$> runInOpenSession s (Model.openSnapshot x1 x2)
8990

9091
duplicate (Table s t) = Table s <$> runInOpenSession s (Model.duplicate t)

0 commit comments

Comments
 (0)