Skip to content

Commit 2795a20

Browse files
committed
fix: LogDatastore fulfills the Datastore interface again. Run the TestSuite on the LogDatastore
1 parent e392c15 commit 2795a20

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

basic_ds.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ func (d *LogDatastore) Put(key Key, value []byte) (err error) {
171171
return d.child.Put(key, value)
172172
}
173173

174+
// Sync implements Datastore.Sync
175+
func (d *LogDatastore) Sync(prefix Key) error {
176+
log.Printf("%s: Sync %s\n", d.Name, prefix)
177+
return d.child.Sync(prefix)
178+
}
179+
174180
// Get implements Datastore.Get
175181
func (d *LogDatastore) Get(key Key) (value []byte, err error) {
176182
log.Printf("%s: Get %s\n", d.Name, key)

basic_ds_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ func TestNullDatastore(t *testing.T) {
1717
// The only test that passes. Nothing should be found.
1818
dstest.SubtestNotFounds(t, ds)
1919
}
20+
21+
func TestLogDatastore(t *testing.T) {
22+
ds := dstore.NewLogDatastore(dstore.NewMapDatastore(), "")
23+
dstest.SubtestAll(t, ds)
24+
}

0 commit comments

Comments
 (0)