()
| 225 | |
| 226 | #[test] |
| 227 | fn print_empty() { |
| 228 | for format in [ |
| 229 | PrintFormat::Csv, |
| 230 | PrintFormat::Tsv, |
| 231 | PrintFormat::Json, |
| 232 | PrintFormat::NdJson, |
| 233 | PrintFormat::Automatic, |
| 234 | ] { |
| 235 | // no output for empty batches, even with header set |
| 236 | let output = PrintBatchesTest::new() |
| 237 | .with_format(format) |
| 238 | .with_schema(three_column_schema()) |
| 239 | .with_batches(vec![]) |
| 240 | .run(); |
| 241 | assert_eq!(output, "") |
| 242 | } |
| 243 | |
| 244 | // output column headers for empty batches when format is Table |
| 245 | let output = PrintBatchesTest::new() |
| 246 | .with_format(PrintFormat::Table) |
| 247 | .with_schema(three_column_schema()) |
| 248 | .with_batches(vec![]) |
| 249 | .run(); |
| 250 | assert_snapshot!(output, @r" |
| 251 | +---+---+---+ |
| 252 | | a | b | c | |
| 253 | +---+---+---+ |
| 254 | +---+---+---+ |
| 255 | "); |
| 256 | } |
| 257 | |
| 258 | #[test] |
| 259 | fn print_csv_no_header() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…