| 456 | type unique bool |
| 457 | |
| 458 | func TestCustomDiff(t *testing.T) { |
| 459 | assert := assert.To(t) |
| 460 | custom := compare.Custom{} |
| 461 | got := custom.Diff(unique(false), unique(true), 1) |
| 462 | diff := []compare.Path{root.Diff(unique(false), unique(true))} |
| 463 | assert.For("pre-register").ThatSlice(got).DeepEquals(diff) |
| 464 | custom.Register(func(compare.Comparator, unique, unique) {}) |
| 465 | got = custom.Diff(unique(false), unique(true), 1) |
| 466 | assert.For("pre-register").ThatSlice(got).DeepEquals(noDiff) |
| 467 | } |
| 468 | |
| 469 | func TestInvalidCustomAction(t *testing.T) { |
| 470 | assert := assert.To(t) |