MCPcopy
hub / github.com/perkeep/perkeep / testDeletePartialNotFoundBatch

Function testDeletePartialNotFoundBatch

pkg/sorted/kvtest/kvtest.go:104–117  ·  view source on GitHub ↗
(t *testing.T, kv sorted.KeyValue)

Source from the content-addressed store, hash-verified

102}
103
104func testDeletePartialNotFoundBatch(t *testing.T, kv sorted.KeyValue) {
105 if err := kv.Set(butIExistKey, "whatever"); err != nil {
106 t.Fatal(err)
107 }
108 b := kv.BeginBatch()
109 b.Delete(notExistKey)
110 b.Delete(butIExistKey)
111 if err := kv.CommitBatch(b); err != nil {
112 t.Fatalf("Batch deletion with one non existing key returned an error: %v", err)
113 }
114 if val, err := kv.Get(butIExistKey); err != sorted.ErrNotFound || val != "" {
115 t.Fatalf("Key %q should have been batch deleted", butIExistKey)
116 }
117}
118
119func testInsertLarge(t *testing.T, kv sorted.KeyValue) {
120 largeKey := make([]byte, sorted.MaxKeySize-1)

Callers 1

TestSortedFunction · 0.85

Calls 7

FatalMethod · 0.80
SetMethod · 0.65
BeginBatchMethod · 0.65
DeleteMethod · 0.65
CommitBatchMethod · 0.65
FatalfMethod · 0.65
GetMethod · 0.65

Tested by 1

TestSortedFunction · 0.68