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

Method TestNewDirWithOneFile

utils/merkletrie/internal/fsnoder/dir_test.go:126–137  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

124}
125
126func (s *DirSuite) TestNewDirWithOneFile(c *C) {
127 a, err := newFile("a", "1")
128 c.Assert(err, IsNil)
129
130 root, err := newDir("", []noder.Noder{a})
131 c.Assert(err, IsNil)
132 c.Assert(root.Hash(), DeepEquals,
133 []byte{0x96, 0xab, 0x29, 0x54, 0x2, 0x9e, 0x89, 0x28})
134 c.Assert(root.Name(), Equals, "")
135 assertChildren(c, root, []noder.Noder{a})
136 c.Assert(root.String(), Equals, "(a<1>)")
137}
138
139func (s *DirSuite) TestDirsWithSameFileHaveSameHash(c *C) {
140 f1, err := newFile("a", "1")

Callers

nothing calls this directly

Calls 6

newFileFunction · 0.85
newDirFunction · 0.85
assertChildrenFunction · 0.85
HashMethod · 0.65
NameMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected