summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAbin Simon <abinsimon10@gmail.com>2021-02-14 21:46:31 +0530
committerAbin Simon <abinsimon10@gmail.com>2021-02-15 09:35:14 +0530
commit24e6335e0a73a24ba7138e5510b3db7ce5d19051 (patch)
tree74bdc21aac2202187c453a1cee4875bac1ce1229 /tests
parent0ca699ee2f9c951948d02c83b6c0a45190969e22 (diff)
Fix sorting with almost-all flag and a folder
With a folder structure (a folder `z` with a file `a`), if we do `lsd -a` it used to be: . a .. instead of . .. a This was caused to the the parent meta having full path and us using z/.. to sort .. entry. This should now be fixed with manually changing the name to a .. .
Diffstat (limited to 'tests')
-rw-r--r--tests/integration.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/integration.rs b/tests/integration.rs
index 8d34eb6..b65ff03 100644
--- a/tests/integration.rs
+++ b/tests/integration.rs
@@ -98,6 +98,21 @@ fn test_list_all_populated_directory() {
}
#[test]
+fn test_almost_sort_with_folder() {
+ let tmp = tempdir();
+ tmp.child("z").create_dir_all().unwrap();
+ tmp.child("z/a").touch().unwrap();
+
+ cmd()
+ .current_dir(tmp.path())
+ .arg("-a")
+ .arg("--ignore-config")
+ .arg("z")
+ .assert()
+ .stdout(predicate::str::is_match("\\.\n\\.\\.\na\n$").unwrap());
+}
+
+#[test]
fn test_list_inode_populated_directory() {
let dir = tempdir();
dir.child("one").touch().unwrap();