[librsvg: 2/8] Add a Windows-specific test for Url




commit 807baaa423f1bdca0ef2d55c555945005317a43a
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Aug 9 20:29:37 2022 -0500

    Add a Windows-specific test for Url
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/728>

 src/url_resolver.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/url_resolver.rs b/src/url_resolver.rs
index 595afa19b..b2393e399 100644
--- a/src/url_resolver.rs
+++ b/src/url_resolver.rs
@@ -235,4 +235,15 @@ mod tests {
             Err(AllowedUrlError::NotSiblingOrChildOfBaseFile)
         ));
     }
+
+    #[cfg(windows)]
+    #[test]
+    fn invalid_url_from_test_suite() {
+        let resolver = UrlResolver::new(Some(Url::parse("file:///c:/foo.svg").expect("initial url")));
+        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]