Skip to content

Commit

Permalink
Simplify boxing of output buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-mausch committed Jul 3, 2023
1 parent c76d233 commit 934797e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/csv_test.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
use std::io::Write;
use std::str::from_utf8;

use haspa_camt052_to_csv::Format::Csv;
use haspa_camt052_to_csv::process;

#[test]
fn test_add() {
fn test_csv() {
let mut buf = Vec::new();
{
let mut x: Box<dyn Write> = Box::new(&mut buf);
process(vec!["./tests/camt052.xml".to_string()], Csv, &mut x).unwrap();
}
process(vec!["./tests/camt052.xml".to_string()], Csv, &mut Box::new(&mut buf)).unwrap();

let expected_output = std::fs::read_to_string("./tests/camt052.csv").unwrap();
assert_eq!(from_utf8(&buf).unwrap(), expected_output, "CSV Output");
Expand Down

0 comments on commit 934797e

Please sign in to comment.