-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from solidiquis/opt/show-hardlinks
show hardlinks but don't duplicate file size count
- Loading branch information
Showing
5 changed files
with
73 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use indoc::indoc; | ||
use std::{env::current_dir, error::Error, fs}; | ||
|
||
mod utils; | ||
|
||
#[test] | ||
fn hardlink() -> Result<(), Box<dyn Error>> { | ||
let current_dir = current_dir()?; | ||
|
||
let src = current_dir | ||
.join("tests") | ||
.join("hardlinks") | ||
.join("kadath.txt"); | ||
|
||
let link = current_dir | ||
.join("tests") | ||
.join("hardlinks") | ||
.join("curwin.hpl"); | ||
|
||
fs::hard_link(&src, &link)?; | ||
|
||
let out = utils::run_cmd(&["--sort", "name", "tests/hardlinks"]); | ||
|
||
fs::remove_file(&link)?; | ||
|
||
assert_eq!( | ||
out, | ||
indoc!( | ||
"157 B hardlinks | ||
157 B ├─ curwin.hpl | ||
157 B └─ kadath.txt | ||
2 files" | ||
) | ||
); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
“It was a song, but not the song of any voice. Night and the spheres sang it, and it was old when space and Nyarlathotep and the Other Gods were born.” |