~matthiasbeyer/imag

64b1d9c79ceee2b383050e299686cadad167cc3d — Matthias Beyer 2 years ago 45d0d2d
Add more debug output
2 files changed, 18 insertions(+), 1 deletions(-)

M lib/entry/libimagentryurl/src/link.rs
M lib/entry/libimagentryurl/src/linker.rs
M lib/entry/libimagentryurl/src/link.rs => lib/entry/libimagentryurl/src/link.rs +2 -0
@@ 72,6 72,8 @@ impl Link for Entry {
            .map_err(Error::from)?
            .unwrap_or_else(|| Default::default());

        debug!("Partial deserialized: {:?}", partial);

        let url = match partial.uri {
            Some(uri) => uri,
            None      => return Ok(None),

M lib/entry/libimagentryurl/src/linker.rs => lib/entry/libimagentryurl/src/linker.rs +16 -1
@@ 229,7 229,22 @@ mod tests {

        assert!(e.add_url(&store, url.clone()).is_ok());

        assert_eq!(1, e.get_urls(&store).unwrap().count());
        debug!("{:?}", e);
        debug!("Header: {:?}", e.get_header());

        let urls = e.get_urls(&store);
        let urls = match urls {
            Err(e) => {
                debug!("Error: {:?}", e);
                assert!(false);
                unreachable!()
            },
            Ok(urls) => urls.collect::<Vec<_>>(),
        };

        debug!("urls = {:?}", urls);

        assert_eq!(1, urls.len());
        assert_eq!(url, e.get_urls(&store).unwrap().next().unwrap().unwrap());
    }