| 284 | |
| 285 | #[allow(clippy::too_many_arguments)] |
| 286 | fn write_files( |
| 287 | spec_data: &[u8], |
| 288 | ref_data: &[u8], |
| 289 | read_data: &[u8], |
| 290 | highlight_data: &[u8], |
| 291 | coverage_data: &[u8], |
| 292 | spec_path: &Path, |
| 293 | ref_path: &Path, |
| 294 | read_path: &Path, |
| 295 | highlight_path: Option<PathBuf>, |
| 296 | coverage_path: &Path, |
| 297 | ) -> Result<()> { |
| 298 | let mut specs = File::create(spec_path).unwrap(); |
| 299 | specs.write_all(spec_data)?; |
| 300 | let mut read_file = File::create(read_path).unwrap(); |
| 301 | read_file.write_all(read_data)?; |
| 302 | let mut reference_file = File::create(ref_path).unwrap(); |
| 303 | reference_file.write_all(ref_data)?; |
| 304 | let mut coverage_file = File::create(coverage_path).unwrap(); |
| 305 | coverage_file.write_all(coverage_data)?; |
| 306 | if let Some(path) = highlight_path { |
| 307 | let mut highlight_file = File::create(path).unwrap(); |
| 308 | highlight_file.write_all(highlight_data)?; |
| 309 | } |
| 310 | Ok(()) |
| 311 | } |
| 312 | |
| 313 | #[cfg(test)] |
| 314 | mod tests { |