Ejemplo n.º 1
0
func TestBasename(t *testing.T) {
	basename := new(SomeBasename)
	invo, outPipe, errPipe := someutils.InvocationFromReader(strings.NewReader("some/text"))
	err, code := basename.Invoke(invo)
	if err != nil {
		t.Logf("StdErr: %s", errPipe.String())
		t.Errorf("Error: %v - Code %d\n", err, code)
	}
	println(outPipe.String())
	// TODO: 'Output' string for testing?
}
Ejemplo n.º 2
0
func TestCat(t *testing.T) {
	cat := NewCat()
	invo, outPipe, errPipe := someutils.InvocationFromReader(strings.NewReader("some/text"))
	err, code := cat.Invoke(invo)
	if err != nil {
		t.Logf("StdErr: %s", errPipe.String())
		t.Errorf("Error: %v - Code %d\n", err, code)
	}
	println(outPipe.String())
	// Output:
	// HI
}