make format happy
Browse files- src/results/aggregator.rs +27 -8
src/results/aggregator.rs
CHANGED
@@ -227,7 +227,8 @@ mod tests {
|
|
227 |
SearchResult {
|
228 |
title: "Example Domain".to_string(),
|
229 |
url: "https://www.example.com".to_string(),
|
230 |
-
description: "This domain is for use in illustrative examples in documents."
|
|
|
231 |
engine: vec!["Google".to_string(), "Bing".to_string()],
|
232 |
},
|
233 |
);
|
@@ -248,7 +249,11 @@ mod tests {
|
|
248 |
file.flush()?;
|
249 |
|
250 |
let mut resultant_map = HashMap::new();
|
251 |
-
filter_with_lists(
|
|
|
|
|
|
|
|
|
252 |
|
253 |
assert_eq!(resultant_map.len(), 2);
|
254 |
assert!(resultant_map.contains_key("https://www.example.com"));
|
@@ -266,7 +271,8 @@ mod tests {
|
|
266 |
SearchResult {
|
267 |
title: "Example Domain".to_string(),
|
268 |
url: "https://www.example.com".to_string(),
|
269 |
-
description: "This domain is for use in illustrative examples in documents."
|
|
|
270 |
engine: vec!["Google".to_string(), "Bing".to_string()],
|
271 |
},
|
272 |
);
|
@@ -287,7 +293,11 @@ mod tests {
|
|
287 |
|
288 |
let mut resultant_map = HashMap::new();
|
289 |
|
290 |
-
filter_with_lists(
|
|
|
|
|
|
|
|
|
291 |
|
292 |
assert_eq!(resultant_map.len(), 1);
|
293 |
assert!(resultant_map.contains_key("https://www.example.com"));
|
@@ -304,7 +314,11 @@ mod tests {
|
|
304 |
let mut resultant_map = HashMap::new();
|
305 |
|
306 |
// Call the `filter_with_lists` function with a non-existent file path
|
307 |
-
let result = filter_with_lists(
|
|
|
|
|
|
|
|
|
308 |
|
309 |
assert!(result.is_err());
|
310 |
}
|
@@ -317,7 +331,8 @@ mod tests {
|
|
317 |
SearchResult {
|
318 |
title: "Example Domain".to_string(),
|
319 |
url: "https://www.example.com".to_string(),
|
320 |
-
description: "This domain is for use in illustrative examples in documents."
|
|
|
321 |
engine: vec!["Google".to_string(), "Bing".to_string()],
|
322 |
},
|
323 |
);
|
@@ -329,8 +344,12 @@ mod tests {
|
|
329 |
writeln!(file, "example(").unwrap();
|
330 |
file.flush().unwrap();
|
331 |
|
332 |
-
let result = filter_with_lists(
|
|
|
|
|
|
|
|
|
333 |
|
334 |
assert!(result.is_err());
|
|
|
335 |
}
|
336 |
-
}
|
|
|
227 |
SearchResult {
|
228 |
title: "Example Domain".to_string(),
|
229 |
url: "https://www.example.com".to_string(),
|
230 |
+
description: "This domain is for use in illustrative examples in documents."
|
231 |
+
.to_string(),
|
232 |
engine: vec!["Google".to_string(), "Bing".to_string()],
|
233 |
},
|
234 |
);
|
|
|
249 |
file.flush()?;
|
250 |
|
251 |
let mut resultant_map = HashMap::new();
|
252 |
+
filter_with_lists(
|
253 |
+
&mut map_to_be_filtered,
|
254 |
+
&mut resultant_map,
|
255 |
+
file.path().to_str().unwrap(),
|
256 |
+
)?;
|
257 |
|
258 |
assert_eq!(resultant_map.len(), 2);
|
259 |
assert!(resultant_map.contains_key("https://www.example.com"));
|
|
|
271 |
SearchResult {
|
272 |
title: "Example Domain".to_string(),
|
273 |
url: "https://www.example.com".to_string(),
|
274 |
+
description: "This domain is for use in illustrative examples in documents."
|
275 |
+
.to_string(),
|
276 |
engine: vec!["Google".to_string(), "Bing".to_string()],
|
277 |
},
|
278 |
);
|
|
|
293 |
|
294 |
let mut resultant_map = HashMap::new();
|
295 |
|
296 |
+
filter_with_lists(
|
297 |
+
&mut map_to_be_filtered,
|
298 |
+
&mut resultant_map,
|
299 |
+
file.path().to_str().unwrap(),
|
300 |
+
)?;
|
301 |
|
302 |
assert_eq!(resultant_map.len(), 1);
|
303 |
assert!(resultant_map.contains_key("https://www.example.com"));
|
|
|
314 |
let mut resultant_map = HashMap::new();
|
315 |
|
316 |
// Call the `filter_with_lists` function with a non-existent file path
|
317 |
+
let result = filter_with_lists(
|
318 |
+
&mut map_to_be_filtered,
|
319 |
+
&mut resultant_map,
|
320 |
+
"non-existent-file.txt",
|
321 |
+
);
|
322 |
|
323 |
assert!(result.is_err());
|
324 |
}
|
|
|
331 |
SearchResult {
|
332 |
title: "Example Domain".to_string(),
|
333 |
url: "https://www.example.com".to_string(),
|
334 |
+
description: "This domain is for use in illustrative examples in documents."
|
335 |
+
.to_string(),
|
336 |
engine: vec!["Google".to_string(), "Bing".to_string()],
|
337 |
},
|
338 |
);
|
|
|
344 |
writeln!(file, "example(").unwrap();
|
345 |
file.flush().unwrap();
|
346 |
|
347 |
+
let result = filter_with_lists(
|
348 |
+
&mut map_to_be_filtered,
|
349 |
+
&mut resultant_map,
|
350 |
+
file.path().to_str().unwrap(),
|
351 |
+
);
|
352 |
|
353 |
assert!(result.is_err());
|
354 |
+
}
|
355 |
}
|
|