Skip to content

Commit

Permalink
Try to reproduce (#47)
Browse files Browse the repository at this point in the history
It seems to work as expected, also on linux.
  • Loading branch information
Byron committed May 6, 2022
1 parent d9778ba commit 8eba501
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/trash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::path::PathBuf;

use log::trace;

use serial_test::serial;
use trash::{delete, delete_all};

mod util {
Expand All @@ -26,6 +27,7 @@ mod util {
pub use util::{get_unique_name, init_logging};

#[test]
#[serial]
fn test_delete_file() {
init_logging();
trace!("Started test_delete_file");
Expand All @@ -39,6 +41,7 @@ fn test_delete_file() {
}

#[test]
#[serial]
fn test_delete_folder() {
init_logging();
trace!("Started test_delete_folder");
Expand Down Expand Up @@ -124,3 +127,13 @@ mod unix {
trace!("Finished test_delete_symlink_in_folder");
}
}

#[test]
#[serial]
fn create_remove_single_file() {
// Let's create and remove a single file
let name = get_unique_name();
File::create(&name).unwrap();
trash::delete(&name).unwrap();
assert!(File::open(&name).is_err());
}

0 comments on commit 8eba501

Please sign in to comment.