Write bytes to a file inside `dir`, panicking on failure.
(dir: &Path, name: &str, data: &[u8])
| 19 | |
| 20 | /// Write bytes to a file inside `dir`, panicking on failure. |
| 21 | pub fn write_test_file(dir: &Path, name: &str, data: &[u8]) { |
| 22 | let path = dir.join(name); |
| 23 | File::create(&path) |
| 24 | .and_then(|mut file| file.write_all(data)) |
| 25 | .expect("failed to write test file"); |
| 26 | } |
| 27 | |
| 28 | /// Generate a self-signed CA certificate and a `localhost` server certificate, |
| 29 | /// writing them as PEM files into `dir`. |
no outgoing calls
no test coverage detected