Write content to a temporary file and return its path. The caller is responsible for keeping the `tempfile::NamedTempFile` alive.
(content: &str, suffix: &str)
| 16 | /// Write content to a temporary file and return its path. |
| 17 | /// The caller is responsible for keeping the `tempfile::NamedTempFile` alive. |
| 18 | fn write_temp(content: &str, suffix: &str) -> tempfile::NamedTempFile { |
| 19 | let mut f = tempfile::Builder::new() |
| 20 | .suffix(suffix) |
| 21 | .tempfile() |
| 22 | .expect("create temp file"); |
| 23 | f.write_all(content.as_bytes()).expect("write temp file"); |
| 24 | f.flush().expect("flush temp file"); |
| 25 | f |
| 26 | } |
| 27 | |
| 28 | /// Count rows in a collection via SELECT COUNT(*). |
| 29 | async fn count_rows(srv: &TestServer, collection: &str) -> i64 { |
no test coverage detected