|
@@ -16,6 +16,18 @@ import (
|
|
|
"github.com/coreos/etcd/storage/storagepb"
|
|
"github.com/coreos/etcd/storage/storagepb"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+func TestStoreRev(t *testing.T) {
|
|
|
|
|
+ s := newStore(tmpPath)
|
|
|
|
|
+ defer os.Remove(tmpPath)
|
|
|
|
|
+
|
|
|
|
|
+ for i := 0; i < 3; i++ {
|
|
|
|
|
+ s.Put([]byte("foo"), []byte("bar"))
|
|
|
|
|
+ if r := s.Rev(); r != int64(i+1) {
|
|
|
|
|
+ t.Errorf("#%d: rev = %d, want %d", i, r, i+1)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func TestStorePut(t *testing.T) {
|
|
func TestStorePut(t *testing.T) {
|
|
|
tests := []struct {
|
|
tests := []struct {
|
|
|
rev revision
|
|
rev revision
|