MCPcopy
hub / github.com/go-git/go-git / TestDiff

Method TestDiff

utils/merkletrie/filesystem/node_test.go:34–55  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

32var _ = Suite(&NoderSuite{})
33
34func (s *NoderSuite) TestDiff(c *C) {
35 fsA := memfs.New()
36 WriteFile(fsA, "foo", []byte("foo"), 0644)
37 WriteFile(fsA, "qux/bar", []byte("foo"), 0644)
38 WriteFile(fsA, "qux/qux", []byte("foo"), 0644)
39 fsA.Symlink("foo", "bar")
40
41 fsB := memfs.New()
42 WriteFile(fsB, "foo", []byte("foo"), 0644)
43 WriteFile(fsB, "qux/bar", []byte("foo"), 0644)
44 WriteFile(fsB, "qux/qux", []byte("foo"), 0644)
45 fsB.Symlink("foo", "bar")
46
47 ch, err := merkletrie.DiffTree(
48 NewRootNode(fsA, nil),
49 NewRootNode(fsB, nil),
50 IsEquals,
51 )
52
53 c.Assert(err, IsNil)
54 c.Assert(ch, HasLen, 0)
55}
56
57func (s *NoderSuite) TestDiffChangeLink(c *C) {
58 fsA := memfs.New()

Callers

nothing calls this directly

Calls 4

DiffTreeFunction · 0.92
WriteFileFunction · 0.85
NewRootNodeFunction · 0.70
SymlinkMethod · 0.45

Tested by

no test coverage detected