0day_dev/radare2-r2pipe/go/r2pipe_test.go

28 lines
419 B
Go
Raw Normal View History

2020-08-07 20:48:00 +00:00
// radare - LGPL - Copyright 2015 - nibble
package r2pipe
import "testing"
func TestCmd(t *testing.T) {
r2p, err := NewPipe("malloc://256")
if err != nil {
t.Fatal(err)
}
defer r2p.Close()
check := "Hello World"
_, err = r2p.Cmd("w " + check)
if err != nil {
t.Fatal(err)
}
buf, err := r2p.Cmd("ps")
if err != nil {
t.Fatal(err)
}
if buf != check {
t.Errorf("buf=%v; want=%v", buf, check)
}
}