mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 14:03:17 -07:00
Update broken tests
This commit is contained in:
parent
d22befab45
commit
6406885928
8 changed files with 90 additions and 64 deletions
|
@ -101,10 +101,10 @@ func TestCoreExec(t *testing.T) {
|
|||
err string
|
||||
stdout string
|
||||
}{
|
||||
{"foo", []string{}, "", `exec: "foo": executable file not found in $PATH`, `ERROR for 'foo []': exec: "foo": executable file not found in $PATH`},
|
||||
{"ps", []string{"-someinvalidflag"}, "", "exit status 1", "ERROR for 'ps [-someinvalidflag]': exit status 1"},
|
||||
{"foo", []string{}, "", `exec: "foo": executable file not found in $PATH`, ""},
|
||||
{"ps", []string{"-someinvalidflag"}, "", "exit status 1", ""},
|
||||
{"true", []string{}, "", "", ""},
|
||||
{"head", []string{"/path/to/file/that/does/not/exist"}, "", "exit status 1", "ERROR for 'head [/path/to/file/that/does/not/exist]': exit status 1"},
|
||||
{"head", []string{"/path/to/file/that/does/not/exist"}, "", "exit status 1", ""},
|
||||
}
|
||||
|
||||
for _, u := range units {
|
||||
|
@ -114,7 +114,7 @@ func TestCoreExec(t *testing.T) {
|
|||
r, w, _ := os.Pipe()
|
||||
os.Stdout = w
|
||||
|
||||
gotOut, gotErr := ExecSilent(u.exec, u.args)
|
||||
gotOut, gotErr := Exec(u.exec, u.args)
|
||||
w.Close()
|
||||
io.Copy(&buf, r)
|
||||
os.Stdout = oldStdout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue