Exemple #1
0
func commit(t *testing.T, cli *eyes.Client, hash string) {
	res := cli.CommitSync()
	if res.IsErr() {
		t.Error("Unexpected error getting hash", res.Error())
	}
	if hash != Fmt("%X", res.Data) {
		t.Errorf("Expected hash 0x%v but got 0x%X", hash, res.Data)
	}
}
Exemple #2
0
func get(t *testing.T, cli *eyes.Client, key string, value string, err string) {
	res := cli.GetSync([]byte(key))
	if !bytes.Equal([]byte(value), res.Data) {
		t.Errorf("Expected value 0x%X (%v) but got 0x%X", []byte(value), value, res.Data)
	}
	if res.IsOK() {
		if err != "" {
			t.Errorf("Expected error %v but got no error", err)
		}
	} else {
		if err == "" {
			t.Errorf("Expected no error but got error %v", res.Error())
		}
	}
}
Exemple #3
0
func rem(t *testing.T, cli *eyes.Client, key string) {
	cli.RemSync([]byte(key))
}
Exemple #4
0
func set(t *testing.T, cli *eyes.Client, key string, value string) {
	cli.SetSync([]byte(key), []byte(value))
}