viirya commented on code in PR #7329:
URL: https://github.com/apache/datafusion-comet/pull/7329#discussion_r4426007223


##########
native/spark-expr/src/url_funcs/parse_url.rs:
##########
@@ -388,11 +422,83 @@ mod tests {
     // Unit tests for parse_url_component
     // -----------------------------------------------------------------------
 
+    #[test]
+    fn uri_decomposition_matches_appendix_b_regex() {
+        let regex =
+            
Regex::new(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$").unwrap();
+        for url in [
+            "https://u:p@host:80/p?q#f";,
+            "HTTP://host?#",
+            "ftp://[::1]:80//a/b";,
+            "mailto:a@b";,
+            "例:é?k=值#片",
+            "//host/p?x=1#f?y",
+            "scheme:///p",
+            "https:/p",
+            "relative/path:part",
+            ":leading",
+            "?#",
+            "x:/p?a=?b#f#x",

Review Comment:
   nit: the old parity test had a fragment containing `?` (`#f?x=1`), but every 
input here and in `file_and_query_components` has the `?` before the `#`. 
Adding something like `"http://h/p#f?x"` would catch a future change that 
splits on `?` before `#`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to