(
schema: ProductType,
rows: Vec<&RawValue>,
stats: SqlStmtStats,
duration: Option<Duration>,
expect: &str,
)
| 316 | } |
| 317 | |
| 318 | fn check_output( |
| 319 | schema: ProductType, |
| 320 | rows: Vec<&RawValue>, |
| 321 | stats: SqlStmtStats, |
| 322 | duration: Option<Duration>, |
| 323 | expect: &str, |
| 324 | ) -> Result<String, anyhow::Error> { |
| 325 | let table = SqlStmtResult { |
| 326 | schema: schema.clone(), |
| 327 | rows, |
| 328 | total_duration_micros: 1000, |
| 329 | stats: stats.clone(), |
| 330 | }; |
| 331 | |
| 332 | let mut out = String::new(); |
| 333 | print_stmt_result(&[table], duration, &mut out)?; |
| 334 | |
| 335 | // Need to trim the output to because rustfmt remove the `expect` spaces |
| 336 | let out = out.lines().map(|line| line.trim_end()).join("\n"); |
| 337 | assert_eq!(out, expect,); |
| 338 | |
| 339 | Ok(out) |
| 340 | } |
| 341 | |
| 342 | #[test] |
| 343 | fn test_output() -> Result<(), anyhow::Error> { |
searching dependent graphs…