Xuanwo commented on code in PR #6311:
URL: https://github.com/apache/opendal/pull/6311#discussion_r2153658246


##########
bin/oli/tests/integration/ls.rs:
##########
@@ -44,3 +44,39 @@ async fn test_basic_ls() -> Result<()> {
 
     Ok(())
 }
+
+#[tokio::test]
+async fn test_ls_tree() -> Result<()> {
+    let dir = tempfile::tempdir()?;
+    fs::create_dir_all(dir.path().join("a/b"))?;
+
+    let file_root = dir.path().join("file_root");
+    let file_a = dir.path().join("a/file_a");
+    let file_b = dir.path().join("a/b/file_b");
+
+    let content = "hello";
+    fs::write(&file_root, content)?;
+    fs::write(&file_a, content)?;
+    fs::write(&file_b, content)?;
+
+    let current_dir = dir.path().to_string_lossy().to_string() + "/";
+    let t = oli()
+        .arg("ls")
+        .arg("--tree")
+        .arg(current_dir)
+        .assert()
+        .success();
+
+    let output = String::from_utf8(t.get_output().stdout.clone())?;
+    let expected = r#".

Review Comment:
   Can we use the same snapshot testing method so that we don't have to update 
this manually?



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