Skip to content

Commit

Permalink
Merge pull request #2 from thomasschafer/tschafer-fix-tests-windows
Browse files Browse the repository at this point in the history
Fix tests on windows
  • Loading branch information
thomasschafer authored Nov 14, 2024
2 parents 22540f3 + 4a10a69 commit f8bb4a3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,21 @@ async fn test_update_search_results_filtered_dir() {
if let scooter::Results::SearchComplete(search_state) = &app.results {
assert_eq!(search_state.results.len(), 2);

for (file_name, num_matches) in [
("dir1/file1.txt", 0),
("dir2/file2.txt", 1),
("dir2/file3.txt", 1),
for (file_path, num_matches) in [
(Path::new("dir1").join("file1.txt"), 0),
(Path::new("dir2").join("file2.txt"), 1),
(Path::new("dir2").join("file3.txt"), 1),
] {
println!("Results: {:?}", search_state.results);
assert_eq!(
search_state
.results
.iter()
.filter(|r| r.path.to_str().unwrap().contains(file_name))
.filter(|result| {
let result_path = result.path.to_str().unwrap();
let file_path = file_path.to_str().unwrap();
result_path.contains(file_path)
})
.count(),
num_matches
);
Expand Down

0 comments on commit f8bb4a3

Please sign in to comment.