Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude = ["gui"]
resolver = "2"

[workspace.package]
version = "0.6.1"
version = "0.6.2"
edition = "2021"
license = "MIT"
authors = ["kingchenc"]
Expand Down
16 changes: 12 additions & 4 deletions crates/diskghost-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,12 @@ mod tests {
..Default::default()
};
let r = scan_with_progress(&d, 20, &opts, &Progress::default());
assert_eq!(r.total_size, 150, "junk.tmp should be excluded");
// junk.tmp is excluded, leaving keep.bin + deeper.bin. The file count is
// the exact exclusion check; total_size is on-disk (block-rounded on some
// filesystems) so it only gets a lower bound.
assert_eq!(r.total_files, 2, "junk.tmp should be excluded");
assert!(!r.top_files.iter().any(|f| f.path.ends_with("junk.tmp")));
assert!(r.total_size >= 150, "total_size {}", r.total_size);

// Depth 1: only the root's direct children are visited.
let shallow = Options {
Expand Down Expand Up @@ -967,7 +972,8 @@ mod tests {
let r = scan_with_progress(&d, 10, &Options::default(), &p);
assert_eq!(r.total_files, 2);
assert_eq!(p.files(), 2);
assert_eq!(p.bytes(), 30);
// Progress bytes are on-disk (block-rounded on some filesystems).
assert!(p.bytes() >= 30, "progress bytes {}", p.bytes());

// Pre-cancelled: the walk stops immediately and sees nothing.
let c = Progress::default();
Expand Down Expand Up @@ -1043,7 +1049,8 @@ mod tests {
let rep = remove_path(&d, RemoveMode::Delete, true, &Progress::default());
assert!(rep.dry_run);
assert_eq!(rep.files, 3);
assert_eq!(rep.bytes, 1700);
// Freed bytes are on-disk (block-rounded on some filesystems).
assert!(rep.bytes >= 1700, "freed bytes {}", rep.bytes);
assert!(rep.dirs >= 2); // root + a + a/b (root counted by jwalk)
assert!(rep.errors.is_empty());
assert!(d.exists()); // nothing was touched
Expand All @@ -1070,7 +1077,8 @@ mod tests {
write(&f, &[0u8; 321]);
let rep = remove_path(&f, RemoveMode::Delete, false, &Progress::default());
assert_eq!(rep.files, 1);
assert_eq!(rep.bytes, 321);
// Freed bytes are on-disk (block-rounded on some filesystems).
assert!(rep.bytes >= 321, "freed bytes {}", rep.bytes);
assert!(!f.exists());
assert!(d.exists()); // parent left intact
std::fs::remove_dir_all(&d).ok();
Expand Down
4 changes: 2 additions & 2 deletions gui/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[package]
name = "diskghost-gui"
version = "0.6.1"
version = "0.6.2"
edition = "2021"
license = "MIT"
description = "Diskghost desktop GUI (Tauri) — modern disk usage & duplicate finder."
Expand Down
2 changes: 1 addition & 1 deletion gui/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Diskghost",
"version": "0.6.1",
"version": "0.6.2",
"identifier": "org.diskghost.app",
"build": {
"frontendDist": "../ui"
Expand Down