suyanhanx commented on code in PR #2096:
URL: 
https://github.com/apache/incubator-opendal/pull/2096#discussion_r1174674492


##########
core/tests/behavior/list.rs:
##########
@@ -278,6 +280,49 @@ pub async fn test_list_dir_with_file_path(op: Operator) -> 
Result<()> {
     Ok(())
 }
 
+pub async fn test_list_with_start_after(op: Operator) -> Result<()> {

Review Comment:
   Could you add a comment for it?



##########
core/tests/behavior/list.rs:
##########
@@ -278,6 +280,49 @@ pub async fn test_list_dir_with_file_path(op: Operator) -> 
Result<()> {
     Ok(())
 }
 
+pub async fn test_list_with_start_after(op: Operator) -> Result<()> {
+    if !(op.info().capability().list_with_start_after) {
+        return Ok(());
+    }
+
+    let dir = "test_list_with_start_after/";
+    op.create_dir(dir).await?;
+
+    vec!["file-0", "file-1", "file-2", "file-3", "file-4", "file-5"]
+        .iter()
+        .map(|name| format!("{dir}{name}"))
+        .collect::<Vec<String>>()
+        .iter()
+        .map(|name| async {
+            op.write(name, "content")
+                .await
+                .expect("create must succeed");
+        })
+        .collect::<FuturesUnordered<_>>()
+        .collect::<Vec<_>>()
+        .await;
+
+    let option = OpList::new().with_start_after("file-2");
+    let mut objects = op.list_with(dir, option).await?;
+    let mut actual = vec![];
+    while let Some(o) = objects.try_next().await? {
+        let path = o.path().to_string();
+        actual.push(path)
+    }
+
+    let expected = vec!["file-3", "file-4", "file-5"]
+        .iter()
+        .map(|name| format!("{dir}{name}"))
+        .collect::<Vec<String>>();
+
+    assert_eq!(expected, actual);
+
+    op.remove_all(dir).await?;
+    op.delete(dir).await?;

Review Comment:
   In fact, remove_all will remove the dir itself, so you don't need to do 
another delete.



##########
core/tests/behavior/list.rs:
##########
@@ -278,6 +280,49 @@ pub async fn test_list_dir_with_file_path(op: Operator) -> 
Result<()> {
     Ok(())
 }
 
+pub async fn test_list_with_start_after(op: Operator) -> Result<()> {
+    if !(op.info().capability().list_with_start_after) {

Review Comment:
   ```suggestion
       if !op.info().capability().list_with_start_after {
   ```
   



##########
core/tests/behavior/list.rs:
##########
@@ -278,6 +280,49 @@ pub async fn test_list_dir_with_file_path(op: Operator) -> 
Result<()> {
     Ok(())
 }
 
+pub async fn test_list_with_start_after(op: Operator) -> Result<()> {
+    if !(op.info().capability().list_with_start_after) {
+        return Ok(());
+    }
+
+    let dir = "test_list_with_start_after/";

Review Comment:
   Maybe we could use a random name like other tests.



-- 
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]

Reply via email to