func umgr_teardown(c *mgo.Collection, t *testing.T) { if t.Failed() { var v interface{} it := c.Find(bson.M{}).Iter() t.Logf("Datbase documents:") for it.Next(&v) { t.Logf("%#v", v) v = nil } if it.Err() != nil { t.Logf("Error: %s", it.Err()) } } defer c.Database.Session.Close() c.DropCollection() }
}, } if *wrapper != TestAllWrappers { wrappers = []string{*wrapper} log.Printf("Testing wrapper %s.", *wrapper) } } var setupFn = map[string]func(driver interface{}) error{ `mongo`: func(driver interface{}) error { if mgod, ok := driver.(*mgo.Session); ok == true { var col *mgo.Collection col = mgod.DB("upperio_tests").C("birthdays") col.DropCollection() col = mgod.DB("upperio_tests").C("fibonacci") col.DropCollection() col = mgod.DB("upperio_tests").C("is_even") col.DropCollection() col = mgod.DB("upperio_tests").C("CaSe_TesT") col.DropCollection() return nil } return errDriverErr }, `postgresql`: func(driver interface{}) error { if sqld, ok := driver.(*sql.DB); ok == true {