Fixes a broken unit test introduced by #834.

This commit is contained in:
James Phillips 2015-06-09 12:01:20 -07:00
parent c2f8f954e2
commit de29cb4968
1 changed files with 8 additions and 8 deletions

View File

@ -24,21 +24,21 @@ func TestClientPutGetDelete(t *testing.T) {
t.Fatalf("unexpected value: %#v", pair)
}
// Put the key
value := []byte("test")
p := &KVPair{Key: key, Flags: 42, Value: value}
if _, err := kv.Put(p, nil); err != nil {
t.Fatalf("err: %v", err)
}
// Put a key that begins with a '/'
// Put a key that begins with a '/', this should fail
invalidKey := "/test"
value = []byte(invalidKey)
p = &KVPair{Key: key, Flags: 42, Value: value}
p := &KVPair{Key: invalidKey, Flags: 42, Value: value}
if _, err := kv.Put(p, nil); err == nil {
t.Fatalf("Invalid key not detected: %s", invalidKey)
}
// Put the key
p = &KVPair{Key: key, Flags: 42, Value: value}
if _, err := kv.Put(p, nil); err != nil {
t.Fatalf("err: %v", err)
}
// Get should work
pair, meta, err := kv.Get(key, nil)
if err != nil {