mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
more testandset test cases
This commit is contained in:
parent
227d79e2bf
commit
6d27afd1c9
@ -189,6 +189,15 @@ func TestTestAndSet(t *testing.T) {
|
||||
t.Fatalf("[%v/%v] [%v/%v]", e.PrevValue, "car", e.Value, "bar")
|
||||
}
|
||||
|
||||
// test on empty previous value
|
||||
e, err = fs.TestAndSet("/fooDir/foo", "", 0, "bar", Permanent, 4, 1)
|
||||
if err != nil {
|
||||
t.Fatal("test on empty node should be succeeded")
|
||||
}
|
||||
|
||||
if e.Key != "/fooDir/foo" || e.PrevValue != "" || e.Value != "bar" {
|
||||
t.Fatalf("[%v/%v] [%v/%v] [%v/%v]", e.Key, "/fooDir/foo", e.PrevValue, "", e.Value, "bar")
|
||||
}
|
||||
}
|
||||
|
||||
func setAndGet(fs *FileSystem, path string, t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user