(
&self,
path: &Path,
config: config::WitConfig,
kind: TestKind,
tests: &mut HashMap<String, Test>,
)
| 325 | } |
| 326 | |
| 327 | fn insert_test( |
| 328 | &self, |
| 329 | path: &Path, |
| 330 | config: config::WitConfig, |
| 331 | kind: TestKind, |
| 332 | tests: &mut HashMap<String, Test>, |
| 333 | ) -> Result<()> { |
| 334 | let test_name = path |
| 335 | .file_name() |
| 336 | .and_then(|s| s.to_str()) |
| 337 | .context("non-utf-8 filename")?; |
| 338 | let prev = tests.insert( |
| 339 | test_name.to_string(), |
| 340 | Test { |
| 341 | name: test_name.to_string(), |
| 342 | path: path.to_path_buf(), |
| 343 | config, |
| 344 | kind, |
| 345 | }, |
| 346 | ); |
| 347 | if prev.is_some() { |
| 348 | bail!("duplicate test name `{test_name}` found"); |
| 349 | } |
| 350 | Ok(()) |
| 351 | } |
| 352 | |
| 353 | /// Loads a test from `dir` using the `wit` file in the directory specified. |
| 354 | /// |
no test coverage detected