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

Method TestMaxObjectSize

plumbing/format/packfile/encoder_test.go:75–84  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

73}
74
75func (s *EncoderSuite) TestMaxObjectSize(c *C) {
76 o := s.store.NewEncodedObject()
77 o.SetSize(9223372036854775807)
78 o.SetType(plumbing.CommitObject)
79 _, err := s.store.SetEncodedObject(o)
80 c.Assert(err, IsNil)
81 hash, err := s.enc.Encode([]plumbing.Hash{o.Hash()}, 10)
82 c.Assert(err, IsNil)
83 c.Assert(hash.IsZero(), Not(Equals), true)
84}
85
86func (s *EncoderSuite) TestHashNotFound(c *C) {
87 h, err := s.enc.Encode([]plumbing.Hash{plumbing.NewHash("BAD")}, 10)

Callers

nothing calls this directly

Calls 7

SetSizeMethod · 0.95
SetTypeMethod · 0.95
HashMethod · 0.95
NewEncodedObjectMethod · 0.65
SetEncodedObjectMethod · 0.65
EncodeMethod · 0.65
IsZeroMethod · 0.65

Tested by

no test coverage detected