MCPcopy
hub / github.com/coder/websocket / randMessages

Function randMessages

internal/examples/chat/chat_test.go:164–175  ·  view source on GitHub ↗
(n, maxMessageLength int)

Source from the content-addressed store, hash-verified

162}
163
164func randMessages(n, maxMessageLength int) map[string]struct{} {
165 msgs := make(map[string]struct{})
166 for i := 0; i < n; i++ {
167 m := randString(randInt(maxMessageLength))
168 if _, ok := msgs[m]; ok {
169 i--
170 continue
171 }
172 msgs[m] = struct{}{}
173 }
174 return msgs
175}
176
177func assertSuccess(t *testing.T, err error) {
178 t.Helper()

Callers 1

Test_chatServerFunction · 0.85

Calls 2

randStringFunction · 0.85
randIntFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…