MCPcopy Index your code
hub / github.com/tmrts/boilr / TestWritesToString

Function TestWritesToString

pkg/util/stringutil/stringutil_test.go:24–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestWritesToString(t *testing.T) {
25 s := stringutil.NewString("")
26
27 buf := []byte("Test")
28
29 n, err := s.Write(buf)
30 if n != 4 || err != nil {
31 t.Fatalf("s.Read(buf) should have read the contents to the buffer")
32 }
33
34 if s.String() != "Test" {
35 t.Errorf("s.Read(buf) should have read the contents to the buffer -> expected %q got %q", "Test", s.String())
36 }
37}

Callers

nothing calls this directly

Calls 2

StringMethod · 0.95
WriteMethod · 0.80

Tested by

no test coverage detected