MCPcopy Create free account
hub / github.com/Shopify/goose / fillString

Function fillString

syncio/buffer_test.go:54–68  ·  view source on GitHub ↗

Fill buf through n writes of string fus. The initial contents of buf corresponds to the string s; the result is the final contents of buf returned as a string.

(t *testing.T, testname string, buf *Buffer, s string, n int, fus string)

Source from the content-addressed store, hash-verified

52// The initial contents of buf corresponds to the string s;
53// the result is the final contents of buf returned as a string.
54func fillString(t *testing.T, testname string, buf *Buffer, s string, n int, fus string) string {
55 check(t, testname+" (fill 1)", buf, s)
56 for ; n > 0; n-- {
57 m, err := buf.WriteString(fus)
58 if m != len(fus) {
59 t.Errorf(testname+" (fill 2): m == %d, expected %d", m, len(fus))
60 }
61 if err != nil {
62 t.Errorf(testname+" (fill 3): err should always be nil, found err == %s", err)
63 }
64 s += fus
65 check(t, testname+" (fill 4)", buf, s)
66 }
67 return s
68}
69
70// Fill buf through n writes of byte slice fub.
71// The initial contents of buf corresponds to the string s;

Callers 3

TestLargeStringWritesFunction · 0.85
TestLargeStringReadsFunction · 0.85
TestMixedReadsAndWritesFunction · 0.85

Calls 2

checkFunction · 0.85
WriteStringMethod · 0.80

Tested by

no test coverage detected