in core/src/services/webdav/pager.rs [333:432]
fn test_with_multiple_items_mixed() {
let xml = r#"<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/</D:href>
<D:propstat>
<D:prop>
<D:displayname>/</D:displayname>
<D:getlastmodified>Tue, 07 May 2022 06:39:47 GMT</D:getlastmodified>
<D:resourcetype>
<D:collection />
</D:resourcetype>
<D:lockdiscovery />
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:exclusive />
</D:lockscope>
<D:locktype>
<D:write />
</D:locktype>
</D:lockentry>
</D:supportedlock>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>/testdir/</D:href>
<D:propstat>
<D:prop>
<D:displayname>testdir</D:displayname>
<D:getlastmodified>Tue, 07 May 2022 06:40:10 GMT</D:getlastmodified>
<D:resourcetype>
<D:collection />
</D:resourcetype>
<D:lockdiscovery />
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:exclusive />
</D:lockscope>
<D:locktype>
<D:write />
</D:locktype>
</D:lockentry>
</D:supportedlock>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>/test_file</D:href>
<D:propstat>
<D:prop>
<D:displayname>test_file</D:displayname>
<D:getcontentlength>1</D:getcontentlength>
<D:getlastmodified>Tue, 07 May 2022 05:52:22 GMT</D:getlastmodified>
<D:resourcetype></D:resourcetype>
<D:lockdiscovery />
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:exclusive />
</D:lockscope>
<D:locktype>
<D:write />
</D:locktype>
</D:lockentry>
</D:supportedlock>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>"#;
let multistatus = from_str::<Multistatus>(xml).unwrap();
assert_eq!(multistatus.response.len(), 3);
let first_response = &multistatus.response[0];
assert_eq!(first_response.href, "/");
assert_eq!(
first_response.propstat.prop.getlastmodified,
"Tue, 07 May 2022 06:39:47 GMT"
);
let second_response = &multistatus.response[1];
assert_eq!(second_response.href, "/testdir/");
assert_eq!(
second_response.propstat.prop.getlastmodified,
"Tue, 07 May 2022 06:40:10 GMT"
);
let third_response = &multistatus.response[2];
assert_eq!(third_response.href, "/test_file");
assert_eq!(
third_response.propstat.prop.getlastmodified,
"Tue, 07 May 2022 05:52:22 GMT"
);
}