conflicts: add test of higher-arity conflict simplificaton changing diffs

It's a bit weird to simplify a conflict like `A B->C D->E C->F` to `A
B->E D->F` because it changes which diffs are in the conflict, but
that's what we currently do. Let's have a test for that.

We actually already have tests showing how `A B->C D->A` gets
simplified to `C B->D`, but those are less obviously weird because
when rendered as `removes = [B], adds = [C, D]`, it doesn't look that
different from the reverse.
This commit is contained in:
Martin von Zweigbergk 2023-06-20 06:13:23 -07:00 committed by Martin von Zweigbergk
parent e1b4fde5b3
commit 8f75a8236a

View file

@ -688,6 +688,12 @@ mod tests {
assert_eq!(c(&[0, 1], &[2, 3, 2]).simplify(), c(&[0, 1], &[2, 3, 2]));
assert_eq!(c(&[0, 1], &[2, 3, 3]).simplify(), c(&[0, 1], &[2, 3, 3]));
assert_eq!(c(&[0, 1], &[2, 3, 4]).simplify(), c(&[0, 1], &[2, 3, 4]));
// TODO: we should probably not change the diffs around like this (e.g. 1->5
// before and 1->4 after)
assert_eq!(
c(&[0, 1, 2], &[3, 4, 5, 0]).simplify(),
c(&[1, 2], &[3, 4, 5])
);
}
#[test]