chore: fix tests on mac
ci/woodpecker/push/woodpecker Pipeline was successful Details

feat/type-attributes
Tomáš Mládek 2023-06-18 17:47:39 +02:00 committed by Tomáš Mládek
parent 87156b5fbb
commit 154c379855
1 changed files with 9 additions and 7 deletions

View File

@ -770,16 +770,17 @@ mod test {
fn test_update() {
// Prepare temporary filesystem structure
let temp_dir = TempDir::new().unwrap();
let temp_dir_path = temp_dir.path().canonicalize().unwrap();
let file_path = temp_dir.path().join("my-temporary-note.txt");
let file_path = temp_dir_path.join("my-temporary-note.txt");
let mut tmp_file = File::create(file_path).unwrap();
writeln!(tmp_file, "Brian was here. Briefly.").unwrap();
let file_path = temp_dir.path().join("hello-world.txt");
let file_path = temp_dir_path.join("hello-world.txt");
let mut tmp_file = File::create(file_path).unwrap();
writeln!(tmp_file, "Hello, World!").unwrap();
let file_path = temp_dir.path().join("empty");
let file_path = temp_dir_path.join("empty");
File::create(file_path).unwrap();
// Initialize database
@ -807,16 +808,17 @@ mod test {
fn _test_rescan(quick: bool) {
// Prepare temporary filesystem structure
let temp_dir = TempDir::new().unwrap();
let temp_dir_path = temp_dir.path().canonicalize().unwrap();
let file_path = temp_dir.path().join("my-temporary-note.txt");
let file_path = temp_dir_path.join("my-temporary-note.txt");
let mut tmp_file = File::create(file_path).unwrap();
writeln!(tmp_file, "Brian was here. Briefly.").unwrap();
let file_path = temp_dir.path().join("hello-world.txt");
let file_path = temp_dir_path.join("hello-world.txt");
let mut tmp_file = File::create(file_path).unwrap();
writeln!(tmp_file, "Hello, World!").unwrap();
let empty_path = temp_dir.path().join("empty");
let empty_path = temp_dir_path.join("empty");
File::create(&empty_path).unwrap();
// Initialize database
@ -852,7 +854,7 @@ mod test {
});
// Remove a file
std::fs::remove_file(temp_dir.path().join("hello-world.txt")).unwrap();
std::fs::remove_file(temp_dir_path.join("hello-world.txt")).unwrap();
let job = job_container.add_job("RESCAN", "TEST JOB").unwrap();
let rescan_result = store.rescan_vault(&open_result.db, job, quick, false);