1pub mod flow;
13pub mod model;
14pub mod test_files;
15
16#[cfg(all(feature = "log", not(feature = "tracing")))]
17mod internal_prelude {
18 #[allow(unused_imports)]
19 pub use log::{debug, error, info, trace, warn};
20}
21
22#[cfg(all(feature = "tracing", not(feature = "log")))]
23mod internal_prelude {
24 #[allow(unused_imports)]
25 pub use tracing::{debug, error, info, trace, warn};
26}
27
28#[cfg(all(feature = "log", feature = "tracing"))]
29compile_error!(
30 "feature \"log\" and feature \"tracing\" are enabled at the same time for 'wot-search-tests'. Falling back to log"
31);
32
33enum SearchTestError {
34 BadAmount,
35 BadPathCount,
36}
37
38fn compare_paths(expected: &[String], found: &wot_network::search::Path) {
40 assert_eq!(
42 expected.len(),
43 found.length(),
44 "Length mismatch in compare_paths. Comparing paths {expected:#?} and {found:#?}"
45 );
46
47 let matching = std::iter::zip(expected, found.certificates()).all(|(e, f)| e == &f.to_string());
49
50 if !matching {
51 panic!(
52 "expected {:?} vs. found path {:?}",
53 expected,
54 found.certificates()
55 );
56 }
57}