diff options
author | Colin Cross <ccross@android.com> | 2018-09-19 16:05:43 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2018-09-19 16:17:10 -0700 |
commit | cc1ec0fedc0e74183891973c327d21201734c585 (patch) | |
tree | bd035ec59d0845e95b0df9cada2fe9a87ce52bdd /proptools/escape_test.go | |
parent | 0799fad550029be4109db6d81189edf20eb720c7 (diff) | |
download | android_build_blueprint-cc1ec0fedc0e74183891973c327d21201734c585.tar.gz android_build_blueprint-cc1ec0fedc0e74183891973c327d21201734c585.tar.bz2 android_build_blueprint-cc1ec0fedc0e74183891973c327d21201734c585.zip |
Replace *Escape with *EscapeList
NinjaEscape and ShellEscape operated on lists, which led to
awkward NinjaEscape([]string{s})[0]. Replace NinjaEscape
and ShellEscape with NinjaEscapeList and ShellEscapeList,
and add new NinjaEscape and ShellEscape functions that
operate on a string.
Test: m checkbuild
Change-Id: I283d92cdddc8e0066a300015863a3eab66f77c23
Diffstat (limited to 'proptools/escape_test.go')
-rw-r--r-- | proptools/escape_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/proptools/escape_test.go b/proptools/escape_test.go index f65b9b0..633d711 100644 --- a/proptools/escape_test.go +++ b/proptools/escape_test.go @@ -93,7 +93,7 @@ var shellEscapeTestCase = []escapeTestCase{ func TestNinjaEscaping(t *testing.T) { for _, testCase := range ninjaEscapeTestCase { - got := NinjaEscape([]string{testCase.in})[0] + got := NinjaEscape(testCase.in) if got != testCase.out { t.Errorf("%s: expected `%s` got `%s`", testCase.name, testCase.out, got) } @@ -102,7 +102,7 @@ func TestNinjaEscaping(t *testing.T) { func TestShellEscaping(t *testing.T) { for _, testCase := range shellEscapeTestCase { - got := ShellEscape([]string{testCase.in})[0] + got := ShellEscape(testCase.in) if got != testCase.out { t.Errorf("%s: expected `%s` got `%s`", testCase.name, testCase.out, got) } @@ -114,7 +114,7 @@ func TestExternalShellEscaping(t *testing.T) { return } for _, testCase := range shellEscapeTestCase { - cmd := "echo -n " + ShellEscape([]string{testCase.in})[0] + cmd := "echo -n " + ShellEscape(testCase.in) got, err := exec.Command("/bin/sh", "-c", cmd).Output() if err != nil { t.Error(err) |