Merge "Fix TestExternalShellEscaping and TestExternalShellEscapeIncludingSpaces on darwin" into main am: e1d71ae428
am: 083f69bbcd
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2878400 Change-Id: I621764dea2d42d1a45aadc0b4abd0ac5f6d52708 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
e489b79327
1 changed files with 5 additions and 2 deletions
|
@ -15,6 +15,7 @@
|
|||
package proptools
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
@ -143,8 +144,9 @@ func TestExternalShellEscaping(t *testing.T) {
|
|||
return
|
||||
}
|
||||
for _, testCase := range shellEscapeTestCase {
|
||||
cmd := "echo -n " + ShellEscape(testCase.in)
|
||||
cmd := "echo " + ShellEscape(testCase.in)
|
||||
got, err := exec.Command("/bin/sh", "-c", cmd).Output()
|
||||
got = bytes.TrimSuffix(got, []byte("\n"))
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
@ -159,8 +161,9 @@ func TestExternalShellEscapeIncludingSpaces(t *testing.T) {
|
|||
return
|
||||
}
|
||||
for _, testCase := range shellEscapeIncludingSpacesTestCase {
|
||||
cmd := "echo -n " + ShellEscapeIncludingSpaces(testCase.in)
|
||||
cmd := "echo " + ShellEscapeIncludingSpaces(testCase.in)
|
||||
got, err := exec.Command("/bin/sh", "-c", cmd).Output()
|
||||
got = bytes.TrimSuffix(got, []byte("\n"))
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue