MCPcopy Create free account
hub / github.com/cockroachdb/redact / checkBalanced

Function checkBalanced

internal/buffer/buffer_test.go:36–57  ·  view source on GitHub ↗
(t *testing.T, s string)

Source from the content-addressed store, hash-verified

34}
35
36func checkBalanced(t *testing.T, s string) {
37 t.Helper()
38 open := false
39 for i, c := range s {
40 if c == m.Start {
41 if open {
42 t.Errorf("unexpected open marker at position %d: %q", i, s)
43 return
44 }
45 open = true
46 } else if c == m.End {
47 if !open {
48 t.Errorf("unexpected close marker at position %d: %q", i, s)
49 return
50 }
51 open = false
52 }
53 }
54 if open {
55 t.Errorf("missing close marker at end of string: %q", s)
56 }
57}
58
59func (b *Buffer) checkEqual(t *testing.T, expected string) {
60 t.Helper()

Callers 1

checkInvariantsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…