MCPcopy Create free account
hub / github.com/go-git/go-billy / TestFileWrite

Method TestFileWrite

test/basic.go:220–233  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

218}
219
220func (s *BasicSuite) TestFileWrite(c *C) {
221 f, err := s.FS.Create("foo")
222 c.Assert(err, IsNil)
223
224 n, err := f.Write([]byte("foo"))
225 c.Assert(err, IsNil)
226 c.Assert(n, Equals, 3)
227
228 f.Seek(0, io.SeekStart)
229 all, err := ioutil.ReadAll(f)
230 c.Assert(err, IsNil)
231 c.Assert(string(all), Equals, "foo")
232 c.Assert(f.Close(), IsNil)
233}
234
235func (s *BasicSuite) TestFileWriteClose(c *C) {
236 f, err := s.FS.Create("foo")

Callers

nothing calls this directly

Calls 4

WriteMethod · 0.80
CreateMethod · 0.65
SeekMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected