Byron/trash-rs

Tests don't remove created files.

Offen

#66 geöffnet am 02.05.2023

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Rust (40 Forks)auto 404
enhancementhelp wanted

Repository-Metriken

Stars
 (247 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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();
}

Contributor Guide