webdav: run "gofmt -s" to simplify some tests.

Change-Id: Ie7422dd04b4d7a14059e33ac19cb82691cff3d3f
Reviewed-on: https://go-review.googlesource.com/21632
Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
Nigel Tao
2016-04-07 11:53:01 +10:00
parent 9622a22758
commit bcb71dd18f
2 changed files with 22 additions and 22 deletions

View File

@@ -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"},
},
}},
}, {

View File

@@ -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)