Helper to create a writer and run a test function, then return the buffer contents
(f: F)
| 482 | |
| 483 | /// Helper to create a writer and run a test function, then return the buffer contents |
| 484 | fn with_writer<F>(f: F) -> Vec<u8> |
| 485 | where |
| 486 | F: FnOnce(&mut ConflictWriter<&mut Vec<u8>>), |
| 487 | { |
| 488 | let mut buffer = Vec::new(); |
| 489 | { |
| 490 | let mut writer = ConflictWriter::new(&mut buffer, "test.rs", test_position()); |
| 491 | f(&mut writer); |
| 492 | } |
| 493 | buffer |
| 494 | } |
| 495 | |
| 496 | // ------------------------------------------------------------------------ |
| 497 | // Constructor Tests |