Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests don't remove created files. #66

Open
juanPabloMiceli opened this issue May 2, 2023 · 1 comment
Open

Tests don't remove created files. #66

juanPabloMiceli opened this issue May 2, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@juanPabloMiceli
Copy link

Running cargo test doesn't remove the files/folders created during tests as shown below.
image
Of course, these are mostly 0 bytes files but I think it is a little bit messy to leave them there, I can't think of any reason for not deleting them, but maybe I am missing something.

Proposed solution

As far as I could see, all tests are more or less of the form:

fn test_delete_file() {
    create_things_to_be_deleted();
    attempt_to_delete_using_trash();
    assert_deletion();
}

What I propose is adding one more block to the tests where we attempt to delete the created files like so.

fn test_delete_file() {
    create_things_to_be_deleted();
    attempt_to_delete_using_trash();
    delete_from_trash_manually();
    assert_deletion();
}
@Byron Byron added enhancement New feature or request help wanted Extra attention is needed labels May 3, 2023
@Byron
Copy link
Owner

Byron commented May 3, 2023

Maybe this would be a good case for also making the trashed path available afterwards (as previously suggested here).

That way, selectively clearing trash items should be easily possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants