(
#[files("tests/parse_errors/files/*.files")] file: PathBuf,
)
| 57 | /// and the file's contents as description. |
| 58 | #[rstest] |
| 59 | fn ensure_files_parse_errors( |
| 60 | #[files("tests/parse_errors/files/*.files")] file: PathBuf, |
| 61 | ) -> TestResult { |
| 62 | let input = read_to_string(&file)?; |
| 63 | let result = DbFiles::from_str_with_schema( |
| 64 | &input, |
| 65 | Some(alpm_db::files::DbFilesSchema::V1(SchemaVersion::new( |
| 66 | Version::new(1, 0, 0), |
| 67 | ))), |
| 68 | ); |
| 69 | |
| 70 | match result { |
| 71 | Ok(files) => panic!("Should have failed but created DbFiles:\n{files}"), |
| 72 | Err(error) => { |
| 73 | let name = file |
| 74 | .file_stem() |
| 75 | .and_then(|s| s.to_str()) |
| 76 | .unwrap_or("UNKNOWN FILE"); |
| 77 | |
| 78 | insta::with_settings!({ |
| 79 | description => &input, |
| 80 | snapshot_path => "parse_errors/files/snapshots", |
| 81 | prepend_module_to_snapshot => false, |
| 82 | }, { |
| 83 | assert_snapshot!(name, error.to_string()); |
| 84 | }) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | Ok(()) |
| 89 | } |
nothing calls this directly
no outgoing calls
no test coverage detected