Example #1
0
func asyncFlushAndQuitOnCompletion(t *testing.T, client redis.AsyncClient) {
	// flush it
	fStat, e := client.Flushdb()
	if e != nil {
		t.Errorf("on Flushdb - %s", e)
	}
	ok, fe := fStat.Get()
	if fe != nil {
		t.Fatalf("BUG - non-Error future result get must never return error - got: %s", fe)
	}
	if !ok {
		t.Fatalf("BUG - non-Error flushdb future result must always be true ")
	}

	fStat, e = client.Quit()
	if e != nil {
		t.Errorf("on Quit - %s", e)
	}
	ok, fe = fStat.Get()
	if fe != nil {
		t.Fatalf("BUG - non-Error future result get must never return error - got: %s", fe)
	}
	if !ok {
		t.Fatalf("BUG - non-Error quit future result must always be true ")
	}
}
Example #2
0
func QuitAsyncClient(t *testing.T, client redis.AsyncClient) {
	// flush it
	fstat, e := client.Quit()
	if e != nil {
		t.Fatalf("on Quit - %s", e)
	}
	ok, fe := fstat.Get()
	if fe != nil {
		t.Fatalf("on fstat.Get() - %s", fe)
	}
	if !ok {
		t.Fatalf("fstat.Get() returned false")
	}
}