fork of go-git with some jj specific features
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

utils: diff, gocheck to testify migration. Fixes #1317

+13 -10
+13 -10
utils/diff/diff_ext_test.go
··· 1 1 package diff_test 2 2 3 3 import ( 4 + "fmt" 4 5 "testing" 5 6 6 7 "github.com/go-git/go-git/v5/utils/diff" 8 + "github.com/stretchr/testify/suite" 7 9 8 10 "github.com/sergi/go-diff/diffmatchpatch" 9 - . "gopkg.in/check.v1" 10 11 ) 11 12 12 - func Test(t *testing.T) { TestingT(t) } 13 + type suiteCommon struct { 14 + suite.Suite 15 + } 13 16 14 - type suiteCommon struct{} 15 - 16 - var _ = Suite(&suiteCommon{}) 17 + func TestSuiteCommon(t *testing.T) { 18 + suite.Run(t, new(suiteCommon)) 19 + } 17 20 18 21 var diffTests = [...]struct { 19 22 src string // the src string to diff ··· 40 43 {"a\nbbbbb\n\tccc\ndd\n\tfffffffff\n", "bbbbb\n\tccc\n\tDD\n\tffff\n"}, 41 44 } 42 45 43 - func (s *suiteCommon) TestAll(c *C) { 46 + func (s *suiteCommon) TestAll() { 44 47 for i, t := range diffTests { 45 48 diffs := diff.Do(t.src, t.dst) 46 49 src := diff.Src(diffs) 47 50 dst := diff.Dst(diffs) 48 - c.Assert(src, Equals, t.src, Commentf("subtest %d, src=%q, dst=%q, bad calculated src", i, t.src, t.dst)) 49 - c.Assert(dst, Equals, t.dst, Commentf("subtest %d, src=%q, dst=%q, bad calculated dst", i, t.src, t.dst)) 51 + s.Equal(t.src, src, fmt.Sprintf("subtest %d, src=%q, dst=%q, bad calculated src", i, t.src, t.dst)) 52 + s.Equal(t.dst, dst, fmt.Sprintf("subtest %d, src=%q, dst=%q, bad calculated dst", i, t.src, t.dst)) 50 53 } 51 54 } 52 55 ··· 132 135 }, 133 136 } 134 137 135 - func (s *suiteCommon) TestDo(c *C) { 138 + func (s *suiteCommon) TestDo() { 136 139 for i, t := range doTests { 137 140 diffs := diff.Do(t.src, t.dst) 138 - c.Assert(diffs, DeepEquals, t.exp, Commentf("subtest %d", i)) 141 + s.Equal(t.exp, diffs, fmt.Sprintf("subtest %d", i)) 139 142 } 140 143 }