run the test formats batches using parameters and returns the resulting output
(self)
| 564 | /// run the test |
| 565 | /// formats batches using parameters and returns the resulting output |
| 566 | fn run(self) -> String { |
| 567 | match self.with_header { |
| 568 | WithHeader::Yes => self.output_with_header(true), |
| 569 | WithHeader::No => self.output_with_header(false), |
| 570 | WithHeader::Ignored => { |
| 571 | let output = self.output_with_header(true); |
| 572 | // ensure the output is the same without header |
| 573 | let output_without_header = self.output_with_header(false); |
| 574 | assert_eq!( |
| 575 | output, output_without_header, |
| 576 | "Expected output to be the same with or without header" |
| 577 | ); |
| 578 | output |
| 579 | } |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | fn output_with_header(&self, with_header: bool) -> String { |
| 584 | let mut buffer: Vec<u8> = vec![]; |