runner: pipe commands together
This commit is contained in:
@@ -2,9 +2,11 @@ package runner_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"git.gentoo.party/sam/thanks/internal/runner"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_ZCommand(t *testing.T) {
|
||||
@@ -19,3 +21,12 @@ func Test_ZCommand(t *testing.T) {
|
||||
t.Errorf("localRunner failed: %s\n\n%s", err.Error(), out)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Pipelie(t *testing.T) {
|
||||
c1 := exec.Command("echo", "-n", "foo")
|
||||
c2 := exec.Command("rev")
|
||||
out, err := runner.Pipeline(c1, c2)
|
||||
|
||||
assert.Equal(t, "oof", string(out))
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user