| 102 | } |
| 103 | |
| 104 | func 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 | |
| 119 | func testInsertLarge(t *testing.T, kv sorted.KeyValue) { |
| 120 | largeKey := make([]byte, sorted.MaxKeySize-1) |