-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi!
I tried adding the below test case to diffable_impls/collection.rs.
But I'm getting Insert() + Remove() rather than Change() and the test fails.
If I wanted Change() to be reported here instead, what would be the easiest way for me to achieve that?
Or is this an unrealistic expectation? I'm bad at this.
#[test]
fn diff_change() {
use super::Diffable;
let left = b"YES".to_vec();
let right = b"YAS".to_vec();
let diff = left.diff(&right);
if let edit::Edit::Change(diff) = diff {
use collection::Edit::*;
assert_eq!(
diff.into_iter().collect::<Vec<_>>(),
vec![
Copy(&b'Y'),
Change((&b'E', &b'A')),
Copy(&b'S'),
]
);
} else {
unreachable!()
}
}Metadata
Metadata
Assignees
Labels
No labels