summaryrefslogtreecommitdiff
path: root/zip/zip_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2021-03-23 14:16:05 -0700
committer Colin Cross <ccross@android.com> 2021-03-25 11:06:45 -0700
commitfd708b5651be777b444406aaae02dff3c7a4a143 (patch)
tree99c71130963b7536399a6507e44346e379cb38cd /zip/zip_test.go
parent6c968b1f0fc2818f75292820c8146763277973af (diff)
Move response file handling to a separate package
sbox is going to need to read and write response files, move ReadRspFile to its own package. Test: response_test.go Change-Id: Iecb5486b4aaeb2531828743ad8ef784df675e18e
Diffstat (limited to 'zip/zip_test.go')
-rw-r--r--zip/zip_test.go72
1 files changed, 0 insertions, 72 deletions
diff --git a/zip/zip_test.go b/zip/zip_test.go
index b456ef8f2..a37ae41e4 100644
--- a/zip/zip_test.go
+++ b/zip/zip_test.go
@@ -535,78 +535,6 @@ func TestZip(t *testing.T) {
}
}
-func TestReadRespFile(t *testing.T) {
- testCases := []struct {
- name, in string
- out []string
- }{
- {
- name: "single quoting test case 1",
- in: `./cmd '"'-C`,
- out: []string{"./cmd", `"-C`},
- },
- {
- name: "single quoting test case 2",
- in: `./cmd '-C`,
- out: []string{"./cmd", `-C`},
- },
- {
- name: "single quoting test case 3",
- in: `./cmd '\"'-C`,
- out: []string{"./cmd", `\"-C`},
- },
- {
- name: "single quoting test case 4",
- in: `./cmd '\\'-C`,
- out: []string{"./cmd", `\\-C`},
- },
- {
- name: "none quoting test case 1",
- in: `./cmd \'-C`,
- out: []string{"./cmd", `'-C`},
- },
- {
- name: "none quoting test case 2",
- in: `./cmd \\-C`,
- out: []string{"./cmd", `\-C`},
- },
- {
- name: "none quoting test case 3",
- in: `./cmd \"-C`,
- out: []string{"./cmd", `"-C`},
- },
- {
- name: "double quoting test case 1",
- in: `./cmd "'"-C`,
- out: []string{"./cmd", `'-C`},
- },
- {
- name: "double quoting test case 2",
- in: `./cmd "\\"-C`,
- out: []string{"./cmd", `\-C`},
- },
- {
- name: "double quoting test case 3",
- in: `./cmd "\""-C`,
- out: []string{"./cmd", `"-C`},
- },
- {
- name: "ninja rsp file",
- in: "'a'\nb\n'@'\n'foo'\\''bar'\n'foo\"bar'",
- out: []string{"a", "b", "@", "foo'bar", `foo"bar`},
- },
- }
-
- for _, testCase := range testCases {
- t.Run(testCase.name, func(t *testing.T) {
- got := ReadRespFile([]byte(testCase.in))
- if !reflect.DeepEqual(got, testCase.out) {
- t.Errorf("expected %q got %q", testCase.out, got)
- }
- })
- }
-}
-
func TestSrcJar(t *testing.T) {
mockFs := pathtools.MockFs(map[string][]byte{
"wrong_package.java": []byte("package foo;"),