func testSubDump(t *testing.T, c *client.Conn) {
	ch, wa := c.SubDump([]byte("hest"))
	ch <- [2][]byte{[]byte("testSubDumpk1"), []byte("testSubDumpv1")}
	ch <- [2][]byte{[]byte("testSubDumpk2"), []byte("testSubDumpv2")}
	close(ch)
	wa.Wait()
	if val, ex := c.SubGet([]byte("hest"), []byte("testSubDumpk1")); !ex || bytes.Compare(val, []byte("testSubDumpv1")) != 0 {
		t.Errorf("wrong value")
	}
	if val, ex := c.SubGet([]byte("hest"), []byte("testSubDumpk2")); !ex || bytes.Compare(val, []byte("testSubDumpv2")) != 0 {
		t.Errorf("wrong value")
	}
}
Exemple #2
0
func subDump(conn *client.Conn, args []string) {
	dump, wait := conn.SubDump([]byte(args[1]))
	linedump(dump, wait)
}