File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
pkg/kv/kvserver/kvstorage/wag Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 6
6
package wag
7
7
8
8
import (
9
+ "context"
9
10
"fmt"
10
11
"path/filepath"
11
12
"strings"
@@ -39,6 +40,8 @@ func TestWrite(t *testing.T) {
39
40
str , err := print .DecodeWriteBatch (b .Repr ())
40
41
require .NoError (t , err )
41
42
out += fmt .Sprintf (">> %s\n %s" , name , str )
43
+
44
+ require .NoError (t , b .Commit (false /* sync */ ))
42
45
}
43
46
44
47
id := roachpb.FullReplicaID {RangeID : 123 , ReplicaID : 4 }
@@ -50,6 +53,15 @@ func TestWrite(t *testing.T) {
50
53
// recursion. Remove it, and let the caller handle new lines.
51
54
out = strings .ReplaceAll (out , "\n \n " , "\n " )
52
55
echotest .Require (t , out , filepath .Join ("testdata" , t .Name ()+ ".txt" ))
56
+
57
+ // Smoke check that the iterator works.
58
+ var iter Iterator
59
+ count := 0
60
+ for range iter .Iter (context .Background (), s .eng ) {
61
+ count ++
62
+ }
63
+ require .NoError (t , iter .Error ())
64
+ require .Equal (t , 4 , count )
53
65
}
54
66
55
67
type store struct {
You can’t perform that action at this time.
0 commit comments