Skip to content

Commit

Permalink
test: add test cases for prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
unvalley committed Oct 7, 2022
1 parent 65ba95e commit 439f6dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions datafusion/core/src/datasource/listing/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,14 @@ mod tests {
let child = Path::parse("/foob/bar").unwrap();
assert!(url.strip_prefix(&child).is_none());

let url = ListingTableUrl::parse("file:///with space/foo/bar").unwrap();
assert_eq!(url.prefix.as_ref(), "with space/foo/bar");
let url = ListingTableUrl::parse("file:///foo/ bar").unwrap();
assert_eq!(url.prefix.as_ref(), "foo/ bar");

let url = ListingTableUrl::parse("file:///foo/bar?").unwrap();
assert_eq!(url.prefix.as_ref(), "foo/bar");

let url = ListingTableUrl::parse("file:///foo/😺").unwrap();
assert_eq!(url.prefix.as_ref(), "foo/%F0%9F%98%BA");
}

#[test]
Expand Down

0 comments on commit 439f6dc

Please sign in to comment.