author | Nigel Tao
<nigeltao@golang.org> 2016-04-07 01:53:01 UTC |
committer | Nigel Tao
<nigeltao@golang.org> 2016-04-07 02:09:49 UTC |
parent | 9622a22758aa5d2147f6fb3ee0e5f9266caa8d2b |
webdav/prop_test.go | +18 | -18 |
webdav/webdav_test.go | +4 | -4 |
diff --git a/webdav/prop_test.go b/webdav/prop_test.go index ad4ec5b..c55a7ba 100644 --- a/webdav/prop_test.go +++ b/webdav/prop_test.go @@ -75,21 +75,21 @@ func TestMemPS(t *testing.T) { op: "propname", name: "/dir", wantPnames: []xml.Name{ - xml.Name{Space: "DAV:", Local: "resourcetype"}, - xml.Name{Space: "DAV:", Local: "displayname"}, - xml.Name{Space: "DAV:", Local: "supportedlock"}, + {Space: "DAV:", Local: "resourcetype"}, + {Space: "DAV:", Local: "displayname"}, + {Space: "DAV:", Local: "supportedlock"}, }, }, { op: "propname", name: "/file", wantPnames: []xml.Name{ - xml.Name{Space: "DAV:", Local: "resourcetype"}, - xml.Name{Space: "DAV:", Local: "displayname"}, - xml.Name{Space: "DAV:", Local: "getcontentlength"}, - xml.Name{Space: "DAV:", Local: "getlastmodified"}, - xml.Name{Space: "DAV:", Local: "getcontenttype"}, - xml.Name{Space: "DAV:", Local: "getetag"}, - xml.Name{Space: "DAV:", Local: "supportedlock"}, + {Space: "DAV:", Local: "resourcetype"}, + {Space: "DAV:", Local: "displayname"}, + {Space: "DAV:", Local: "getcontentlength"}, + {Space: "DAV:", Local: "getlastmodified"}, + {Space: "DAV:", Local: "getcontenttype"}, + {Space: "DAV:", Local: "getetag"}, + {Space: "DAV:", Local: "supportedlock"}, }, }}, }, { @@ -452,14 +452,14 @@ func TestMemPS(t *testing.T) { op: "propname", name: "/file", wantPnames: []xml.Name{ - xml.Name{Space: "DAV:", Local: "resourcetype"}, - xml.Name{Space: "DAV:", Local: "displayname"}, - xml.Name{Space: "DAV:", Local: "getcontentlength"}, - xml.Name{Space: "DAV:", Local: "getlastmodified"}, - xml.Name{Space: "DAV:", Local: "getcontenttype"}, - xml.Name{Space: "DAV:", Local: "getetag"}, - xml.Name{Space: "DAV:", Local: "supportedlock"}, - xml.Name{Space: "foo", Local: "bar"}, + {Space: "DAV:", Local: "resourcetype"}, + {Space: "DAV:", Local: "displayname"}, + {Space: "DAV:", Local: "getcontentlength"}, + {Space: "DAV:", Local: "getlastmodified"}, + {Space: "DAV:", Local: "getcontenttype"}, + {Space: "DAV:", Local: "getetag"}, + {Space: "DAV:", Local: "supportedlock"}, + {Space: "foo", Local: "bar"}, }, }}, }, { diff --git a/webdav/webdav_test.go b/webdav/webdav_test.go index 70a3bf2..befd96a 100644 --- a/webdav/webdav_test.go +++ b/webdav/webdav_test.go @@ -147,10 +147,10 @@ func TestPrefix(t *testing.T) { } sort.Strings(got) want := map[string][]string{ - "/": []string{"/", "/a", "/a/b", "/a/b/c", "/a/b/e", "/a/b/e/f"}, - "/a/": []string{"/", "/b", "/b/c", "/b/e", "/b/e/f"}, - "/a/b/": []string{"/", "/c", "/e", "/e/f"}, - "/a/b/c/": []string{"/"}, + "/": {"/", "/a", "/a/b", "/a/b/c", "/a/b/e", "/a/b/e/f"}, + "/a/": {"/", "/b", "/b/c", "/b/e", "/b/e/f"}, + "/a/b/": {"/", "/c", "/e", "/e/f"}, + "/a/b/c/": {"/"}, }[prefix] if !reflect.DeepEqual(got, want) { t.Errorf("prefix=%-9q find:\ngot %v\nwant %v", prefix, got, want)