[librsvg: 4/8] It works without a base URL! So write down the requirements.




commit 84945b5249807f43ce2bdfe2d164892a3984de81
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Aug 9 21:23:24 2022 -0500

    It works without a base URL!  So write down the requirements.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/728>

 src/url_resolver.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/url_resolver.rs b/src/url_resolver.rs
index c8162dece..005ef7294 100644
--- a/src/url_resolver.rs
+++ b/src/url_resolver.rs
@@ -239,8 +239,10 @@ mod tests {
     #[cfg(windows)]
     #[test]
     fn invalid_url_from_test_suite() {
-        // let resolver = UrlResolver::new(Some(Url::parse("file:///c:/foo.svg").expect("initial url")));
-        let resolver = UrlResolver::new(None);
+        // This is required for Url to panic.
+        let resolver = UrlResolver::new(Some(Url::parse("file:///c:/foo.svg").expect("initial url")));
+        // With this, it doesn't panic:
+        //   let resolver = UrlResolver::new(None);
         match resolver.resolve_href("file://invalid.css") {
             Ok(_) => println!("yay!"),
             Err(e) => println!("err: {}", e),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]