From 439f6dcd488a501ca37015169d55ddbeb307bddc Mon Sep 17 00:00:00 2001 From: unvalley Date: Fri, 7 Oct 2022 23:22:16 +0900 Subject: [PATCH] test: add test cases for prefix --- datafusion/core/src/datasource/listing/url.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/datafusion/core/src/datasource/listing/url.rs b/datafusion/core/src/datasource/listing/url.rs index c69744d4e368..166d9048c3ba 100644 --- a/datafusion/core/src/datasource/listing/url.rs +++ b/datafusion/core/src/datasource/listing/url.rs @@ -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]