|
|
@@ -51,9 +51,9 @@ func TestSingleNode(t *testing.T) {
|
|
|
// Add a test-and-set test
|
|
|
|
|
|
// First, we'll test we can change the value if we get it write
|
|
|
- result, match, err := c.CompareAndSwap("foo", "foobar", 100, "foo", 0)
|
|
|
+ result, err = c.CompareAndSwap("foo", "foobar", 100, "bar", 0)
|
|
|
|
|
|
- if err != nil || result.Key != "/foo" || result.Value != "foobar" || result.PrevValue != "bar" || result.TTL != 100 || !match {
|
|
|
+ if err != nil || result.Key != "/foo" || result.Value != "foobar" || result.PrevValue != "bar" || result.TTL != 100 {
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
|
@@ -61,7 +61,7 @@ func TestSingleNode(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
// Next, we'll make sure we can't set it without the correct prior value
|
|
|
- _, _, err = c.CompareAndSwap("foo", "foofoo", 100, "bar", 0)
|
|
|
+ _, err = c.CompareAndSwap("foo", "foofoo", 100, "bar", 0)
|
|
|
|
|
|
if err == nil {
|
|
|
t.Fatalf("Set 4 expecting error when setting key with incorrect previous value")
|