Skip to content

Commit

Permalink
Remove flakey test
Browse files Browse the repository at this point in the history
  • Loading branch information
aleury committed Sep 2, 2024
1 parent dee505d commit 05e396c
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ impl Iterator for FileIter {

#[cfg(test)]
mod test {
use super::{from_path, File};
use std::path::PathBuf;
use super::File;

#[test]
fn file_can_be_formatted_as_a_string() {
Expand Down Expand Up @@ -117,18 +116,4 @@ mod test {

assert_eq!(want, files);
}

#[test]
fn from_path_returns_iterator_over_files_in_the_given_path() {
let want = vec![
File::new(PathBuf::from("./testdata/en/hello.txt"), 6),
File::new(PathBuf::from("./testdata/en/world.txt"), 7),
File::new(PathBuf::from("./testdata/es/hola.txt"), 5),
File::new(PathBuf::from("./testdata/es/mundo.txt"), 6),
];
let mut got = from_path("./testdata").unwrap().collect::<Vec<_>>();
// Sort by path for consistent ordering.
got.sort_by_key(|f| f.path.clone());
assert_eq!(want, got);
}
}

0 comments on commit 05e396c

Please sign in to comment.