Closed da-x closed 3 years ago
Hey. Thanks so much for putting all of this detail into the issue!
https://github.com/chinedufn/dipa/blob/9229f40f3737d37e26873247a9decfcd5d1425e5/src/map.rs#L6-L10
And the map tests live here https://github.com/chinedufn/dipa/blob/9229f40f3737d37e26873247a9decfcd5d1425e5/src/map.rs#L160-L182
If you're up for it, feel free to add and pass a minimal failing test case.
Thanks for looking into this. Turns it fails even with Vec<u8>
as type, the map is not needed.
This new test fails at the apply compare stage (disregarding expected_delta
).
#[test]
fn vec_empty_to_one() {
DipaImplTester {
label: None,
start: &mut Vec::<u8>::new(),
end: &vec![0],
expected_delta: vec![],
// No change, none variant is one byte
expected_serialized_patch_size: 1,
expected_did_change: false,
}
.test();
}
Thanks for narrowing this down, fixed!
https://github.com/chinedufn/dipa/commit/5a258aeed0410e47c15026956f9df4aee9dc20c7
Hi,
In the example below quick-check created values that found an issue in applying a delta. This kind of test can be extended to more complex types for arbitrary-generated values.
Example dependencies: