Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add another test

  • Loading branch information...
commit e02f6f03596f8c88ea49f0b54358aaef01fbd4b4 1 parent 3fcc809
Simon Zimmermann authored
Showing with 5 additions and 0 deletions.
  1. +1 −0  schema/schema.go
  2. +4 −0 schema/schema_test.go
1  schema/schema.go
View
@@ -66,6 +66,7 @@ func Put(db *redis.Client, k *Key, s interface{}) (*Key, error) {
for _, o := range prep.unique {
uk := k.Unique(o.name, fmt.Sprintf("%v", *o.value))
var reply *redis.Reply
+ // TODO: Watch key
reply, e = db.Call("GET", uk)
if e != nil {
4 schema/schema_test.go
View
@@ -51,6 +51,10 @@ var putTests = [][]putTest{
{&User{1, "foo", "foo@foo.com"}, NewKey("user", 1), nil},
{&User{2, "bar", "bar@foo.com"}, NewKey("user", 2), nil},
},
+ {
+ {&User{0, "foo", "foo@foo.com"}, NewKey("user", 0), nil},
+ {&User{0, "foo", "foo@foo.com"}, NewKey("user", 0), newUniqueError("username", "foo")},
+ },
}
func TestPut(t *testing.T) {
Please sign in to comment.
Something went wrong with that request. Please try again.