(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func TestReadPropfind(t *testing.T) { |
| 139 | testCases := []struct { |
| 140 | desc string |
| 141 | input string |
| 142 | wantPF propfind |
| 143 | wantStatus int |
| 144 | }{{ |
| 145 | desc: "propfind: propname", |
| 146 | input: "" + |
| 147 | "<A:propfind xmlns:A='DAV:'>\n" + |
| 148 | " <A:propname/>\n" + |
| 149 | "</A:propfind>", |
| 150 | wantPF: propfind{ |
| 151 | XMLName: ixml.Name{Space: "DAV:", Local: "propfind"}, |
| 152 | Propname: new(struct{}), |
| 153 | }, |
| 154 | }, { |
| 155 | desc: "propfind: empty body means allprop", |
| 156 | input: "", |
| 157 | wantPF: propfind{ |
| 158 | Allprop: new(struct{}), |
| 159 | }, |
| 160 | }, { |
| 161 | desc: "propfind: allprop", |
| 162 | input: "" + |
| 163 | "<A:propfind xmlns:A='DAV:'>\n" + |
| 164 | " <A:allprop/>\n" + |
| 165 | "</A:propfind>", |
| 166 | wantPF: propfind{ |
| 167 | XMLName: ixml.Name{Space: "DAV:", Local: "propfind"}, |
| 168 | Allprop: new(struct{}), |
| 169 | }, |
| 170 | }, { |
| 171 | desc: "propfind: allprop followed by include", |
| 172 | input: "" + |
| 173 | "<A:propfind xmlns:A='DAV:'>\n" + |
| 174 | " <A:allprop/>\n" + |
| 175 | " <A:include><A:displayname/></A:include>\n" + |
| 176 | "</A:propfind>", |
| 177 | wantPF: propfind{ |
| 178 | XMLName: ixml.Name{Space: "DAV:", Local: "propfind"}, |
| 179 | Allprop: new(struct{}), |
| 180 | Include: propfindProps{xml.Name{Space: "DAV:", Local: "displayname"}}, |
| 181 | }, |
| 182 | }, { |
| 183 | desc: "propfind: include followed by allprop", |
| 184 | input: "" + |
| 185 | "<A:propfind xmlns:A='DAV:'>\n" + |
| 186 | " <A:include><A:displayname/></A:include>\n" + |
| 187 | " <A:allprop/>\n" + |
| 188 | "</A:propfind>", |
| 189 | wantPF: propfind{ |
| 190 | XMLName: ixml.Name{Space: "DAV:", Local: "propfind"}, |
| 191 | Allprop: new(struct{}), |
| 192 | Include: propfindProps{xml.Name{Space: "DAV:", Local: "displayname"}}, |
| 193 | }, |
| 194 | }, { |
| 195 | desc: "propfind: propfind", |
nothing calls this directly
no test coverage detected