10 func Test(t *testing.T) { check.TestingT(t) }
12 type diffSuite struct{}
14 var _ = check.Suite(&diffSuite{})
16 func (s *diffSuite) TestDiff(c *check.C) {
17 for _, trial := range []struct {
25 expect: []string{"5A>C"},
30 expect: []string{"6del"},
35 expect: []string{"6_7del"},
40 expect: []string{"5del"},
45 expect: []string{"2_3insC"},
50 expect: []string{"3_5delinsCCC"},
55 expect: []string{"2_3insCCC"},
60 expect: []string{"3_4delinsCC", "7_8del", "12_13insC"},
63 // without cleanup, diffmatchpatch solves this as {"3del", "=A", "4_5insA"}
66 expect: []string{"3G>A"},
69 // without cleanup, diffmatchpatch solves this as {"3_4del", "=A", "5_6insAA"}
72 expect: []string{"3_4delinsAA"},
75 // without cleanup, diffmatchpatch solves this as {"3_4del", "=A", "5_6insCA"}
78 expect: []string{"3_4delinsAC"},
81 // without cleanup, diffmatchpatch solves this as {"3_7del", "=A", "8_9insAAACA"}
84 expect: []string{"3_7delinsAAAAC"},
87 // without cleanup, diffmatchpatch solves this as {"3_7del", "=AAAA", "11_12insCAAAA"}
88 a: "aggggggaaaaggggg",
89 b: "agAAAACaaaaggggg",
90 expect: []string{"3_7delinsAAAAC"},
95 expect: []string{"3_4delinsCA"},
100 expect: []string{"3_4delinsAA"},
105 expect: []string{"3G>T"},
110 expect: []string{"4G>A"},
115 diffs, _ := Diff(strings.ToUpper(trial.a), strings.ToUpper(trial.b), 0)
116 for _, v := range diffs {
117 vars = append(vars, v.String())
119 c.Check(vars, check.DeepEquals, trial.expect)