hfutatzhanghb commented on code in PR #7815:
URL: https://github.com/apache/opendal/pull/7815#discussion_r3487823104
##########
core/tests/behavior/async_rename.rs:
##########
@@ -206,3 +214,83 @@ pub async fn test_rename_overwrite(op: Operator) ->
Result<()> {
op.delete(&target_path).await.expect("delete must succeed");
Ok(())
}
+
+/// Rename to a nonexistent path should succeed when if_not_exists is set.
+pub async fn test_rename_with_if_not_exists(op: Operator) -> Result<()> {
+ let parent = format!("{}/", uuid::Uuid::new_v4());
+ let source_path = format!("{parent}source");
+ let (source_content, _) = gen_bytes(op.info().capability());
+
+ op.write(&source_path, source_content.clone()).await?;
+
+ let target_path = format!("{parent}target");
Review Comment:
have added an unit test `test_rename_with_if_not_exists_nested`.
--
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]