()
| 318 | |
| 319 | #[test] |
| 320 | fn test_write_files() { |
| 321 | write_files( |
| 322 | "test spec".as_bytes(), |
| 323 | "test ref".as_bytes(), |
| 324 | "test read".as_bytes(), |
| 325 | "test highlight".as_bytes(), |
| 326 | "test coverage".as_bytes(), |
| 327 | Path::new("/tmp/test_spec.json"), |
| 328 | Path::new("/tmp/test_ref.json"), |
| 329 | Path::new("/tmp/test_read.json"), |
| 330 | Some(PathBuf::from("/tmp/test_highlight.json")), |
| 331 | Path::new("/tmp/test_coverage.json"), |
| 332 | ) |
| 333 | .unwrap(); |
| 334 | assert!(Path::new("/tmp/test_spec.json").exists()); |
| 335 | assert!(Path::new("/tmp/test_ref.json").exists()); |
| 336 | assert!(Path::new("/tmp/test_read.json").exists()); |
| 337 | assert!(Path::new("/tmp/test_highlight.json").exists()); |
| 338 | assert!(Path::new("/tmp/test_coverage.json").exists()); |
| 339 | assert_eq!( |
| 340 | fs::read_to_string("/tmp/test_spec.json").unwrap(), |
| 341 | "test spec" |
| 342 | ); |
| 343 | assert_eq!( |
| 344 | fs::read_to_string("/tmp/test_ref.json").unwrap(), |
| 345 | "test ref" |
| 346 | ); |
| 347 | assert_eq!( |
| 348 | fs::read_to_string("/tmp/test_read.json").unwrap(), |
| 349 | "test read" |
| 350 | ); |
| 351 | assert_eq!( |
| 352 | fs::read_to_string("/tmp/test_highlight.json").unwrap(), |
| 353 | "test highlight" |
| 354 | ); |
| 355 | fs::remove_file("/tmp/test_spec.json").unwrap(); |
| 356 | fs::remove_file("/tmp/test_ref.json").unwrap(); |
| 357 | fs::remove_file("/tmp/test_read.json").unwrap(); |
| 358 | fs::remove_file("/tmp/test_highlight.json").unwrap(); |
| 359 | } |
| 360 | } |
nothing calls this directly
no test coverage detected