siddontang.golib/exec2/exec_test.go

15 lines
226 B
Go
Raw Permalink Normal View History

2014-09-13 17:00:14 +08:00
package exec2
2014-04-22 15:03:07 +08:00
import (
"strings"
"testing"
"time"
)
func TestExec(t *testing.T) {
err := ExecTimeout(1*time.Second, "sleep", "10")
if err != nil && !strings.Contains(err.Error(), "signal: killed") {
t.Fatal(err)
}
}