aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2019-11-02 03:58:16 +0100
committerTeddy Wing2019-11-02 03:58:16 +0100
commitad6c69f73e23896a496090b6046ea0bb40e45f45 (patch)
treef7b7c6fb56471d23925980baa47e4423ad158b40
parentbc0141c3862c57215705bd9820473aa2a085beb0 (diff)
downloadpdf-urls-ad6c69f73e23896a496090b6046ea0bb40e45f45.tar.bz2
get_urls_from_pdf: Allow out of order URLs in test
For now I'm going to allow URLs to be printed out of their apparent visual order. Change the test so that it passes.
-rw-r--r--src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 889a64c..d84ecea 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -62,8 +62,11 @@ mod tests {
"https://science.nasa.gov/news-article/black-hole-image-makes-history",
];
- let urls = get_urls_from_pdf("testdata/Alice's Adventures in Wonderland.pdf");
+ let urls = get_urls_from_pdf("testdata/Alice's Adventures in Wonderland.pdf").unwrap();
- assert_eq!(expected, urls.unwrap());
+ // Allow URLs to be out of order.
+ for url in expected {
+ assert!(urls.contains(&url.to_owned()));
+ }
}
}