This is an automated email from the ASF dual-hosted git repository. suyanhanx pushed a commit to branch test-case-non-ascii-code in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit 545f2b7660b415b535702d4ac0d14c38bcbfaa4f Author: suyanhanx <[email protected]> AuthorDate: Thu Oct 26 00:54:09 2023 +0800 test: case for write with non ascii code in path Signed-off-by: suyanhanx <[email protected]> --- core/tests/behavior/write.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/tests/behavior/write.rs b/core/tests/behavior/write.rs index 675d0c7a3..dcb0f7a10 100644 --- a/core/tests/behavior/write.rs +++ b/core/tests/behavior/write.rs @@ -51,6 +51,7 @@ pub fn behavior_write_tests(op: &Operator) -> Vec<Trial> { test_write_with_empty_content, test_write_with_dir_path, test_write_with_special_chars, + test_write_with_non_ascii_code_in_path, test_write_with_cache_control, test_write_with_content_type, test_write_with_content_disposition, @@ -191,6 +192,20 @@ pub async fn test_write_with_special_chars(op: Operator) -> Result<()> { Ok(()) } +/// Write a single file with non-ascii code in path should succeed. +pub async fn test_write_with_non_ascii_code_in_path(op: Operator) -> Result<()> { + let path = format!("{}ππΊδΈζ.txt", uuid::Uuid::new_v4()); + let (content, size) = gen_bytes(); + + op.write(&path, content).await?; + + let meta = op.stat(&path).await.expect("stat must succeed"); + assert_eq!(meta.content_length(), size as u64); + + op.delete(&path).await.expect("delete must succeed"); + Ok(()) +} + /// Write a single file with cache control should succeed. pub async fn test_write_with_cache_control(op: Operator) -> Result<()> { if !op.info().full_capability().write_with_cache_control {
