chore: fix tests on mac
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
87156b5fbb
commit
154c379855
1 changed files with 9 additions and 7 deletions
|
@ -770,16 +770,17 @@ mod test {
|
||||||
fn test_update() {
|
fn test_update() {
|
||||||
// Prepare temporary filesystem structure
|
// Prepare temporary filesystem structure
|
||||||
let temp_dir = TempDir::new().unwrap();
|
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();
|
let mut tmp_file = File::create(file_path).unwrap();
|
||||||
writeln!(tmp_file, "Brian was here. Briefly.").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();
|
let mut tmp_file = File::create(file_path).unwrap();
|
||||||
writeln!(tmp_file, "Hello, World!").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();
|
File::create(file_path).unwrap();
|
||||||
|
|
||||||
// Initialize database
|
// Initialize database
|
||||||
|
@ -807,16 +808,17 @@ mod test {
|
||||||
fn _test_rescan(quick: bool) {
|
fn _test_rescan(quick: bool) {
|
||||||
// Prepare temporary filesystem structure
|
// Prepare temporary filesystem structure
|
||||||
let temp_dir = TempDir::new().unwrap();
|
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();
|
let mut tmp_file = File::create(file_path).unwrap();
|
||||||
writeln!(tmp_file, "Brian was here. Briefly.").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();
|
let mut tmp_file = File::create(file_path).unwrap();
|
||||||
writeln!(tmp_file, "Hello, World!").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();
|
File::create(&empty_path).unwrap();
|
||||||
|
|
||||||
// Initialize database
|
// Initialize database
|
||||||
|
@ -852,7 +854,7 @@ mod test {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Remove a file
|
// 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 job = job_container.add_job("RESCAN", "TEST JOB").unwrap();
|
||||||
let rescan_result = store.rescan_vault(&open_result.db, job, quick, false);
|
let rescan_result = store.rescan_vault(&open_result.db, job, quick, false);
|
||||||
|
|
Loading…
Reference in a new issue