19 lines
452 B
Go
19 lines
452 B
Go
package owrt
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestRun(t *testing.T) {
|
|
exec := &localExecutor{}
|
|
res := exec.Run("uname", "-a")
|
|
if g, e := res.ReturnCode, 0; g != e {
|
|
t.Errorf("Run command failed ! Got bad return code [%d], [%d} is expected\n", g, e)
|
|
}
|
|
|
|
// res = exec.Run("noCommandWithThisNameExists", "-a")
|
|
// if g, e := res.ReturnCode, 127; g != e {
|
|
// t.Errorf("Run command failed ! Got bad return code [%d], [%d} is expected\n", g, e)
|
|
// }
|
|
}
|