diff --git a/lib/file-source/tests/glob.rs b/lib/file-source/tests/glob.rs index 86379c7ef7af8..36828b7ef942f 100644 --- a/lib/file-source/tests/glob.rs +++ b/lib/file-source/tests/glob.rs @@ -1,5 +1,9 @@ use file_source::paths_provider::{glob::Glob, PathsProvider}; -use std::collections::HashSet; + +fn sorted(mut input: Vec) -> Vec { + input.sort(); + input +} #[test] fn test_glob_include_plain() -> Result<(), Box> { @@ -10,11 +14,11 @@ fn test_glob_include_plain() -> Result<(), Box> { let paths = glob.paths()?; assert_eq!( - paths.into_iter().collect::>(), + paths, ["./tests/files/foo.log"] .iter() .map(std::path::PathBuf::from) - .collect::>() + .collect::>() ); Ok(()) @@ -29,11 +33,11 @@ fn test_glob_include_curly_braces() -> Result<(), Box> { let paths = glob.paths()?; assert_eq!( - paths.into_iter().collect::>(), + sorted(paths), ["./tests/files/foo.log", "./tests/files/bar.log"] .iter() .map(std::path::PathBuf::from) - .collect::>() + .collect::>() ); Ok(()) @@ -48,11 +52,11 @@ fn test_glob_include_curly_braces_exclude_star() -> Result<(), Box>(), + paths, ["./tests/files/bar.log"] .iter() .map(std::path::PathBuf::from) - .collect::>() + .collect::>() ); Ok(())