()
| 475 | |
| 476 | #[test] |
| 477 | fn test_print_batches_empty_batch() { |
| 478 | let empty_batch = RecordBatch::new_empty(one_column_batch().schema()); |
| 479 | |
| 480 | // Print column headers for empty batch when format is Table |
| 481 | let output = PrintBatchesTest::new() |
| 482 | .with_format(PrintFormat::Table) |
| 483 | .with_schema(one_column_schema()) |
| 484 | .with_batches(vec![empty_batch]) |
| 485 | .with_header(WithHeader::Yes) |
| 486 | .run(); |
| 487 | assert_snapshot!(output, @r" |
| 488 | +---+ |
| 489 | | a | |
| 490 | +---+ |
| 491 | +---+ |
| 492 | "); |
| 493 | |
| 494 | // No output for empty batch when schema contains no columns |
| 495 | let empty_batch = RecordBatch::new_empty(Arc::new(Schema::empty())); |
| 496 | let output = PrintBatchesTest::new() |
| 497 | .with_format(PrintFormat::Table) |
| 498 | .with_schema(Arc::new(Schema::empty())) |
| 499 | .with_batches(vec![empty_batch]) |
| 500 | .with_header(WithHeader::Yes) |
| 501 | .run(); |
| 502 | assert_eq!(output, "") |
| 503 | } |
| 504 | |
| 505 | #[derive(Debug)] |
| 506 | struct PrintBatchesTest { |
nothing calls this directly
no test coverage detected
searching dependent graphs…