MCPcopy Index your code
hub / github.com/github/copilot-sdk / newTestSession

Function newTestSession

go/session_test.go:22–30  ·  view source on GitHub ↗

newTestSession creates a session with an event channel and starts the consumer goroutine. Returns a cleanup function that closes the channel (stopping the consumer).

()

Source from the content-addressed store, hash-verified

20// newTestSession creates a session with an event channel and starts the consumer goroutine.
21// Returns a cleanup function that closes the channel (stopping the consumer).
22func newTestSession() (*Session, func()) {
23 s := &Session{
24 handlers: make([]sessionHandler, 0),
25 commandHandlers: make(map[string]CommandHandler),
26 eventCh: make(chan SessionEvent, 128),
27 }
28 go s.processEvents()
29 return s, func() { close(s.eventCh) }
30}
31
32func newTestEvent() SessionEvent {
33 return SessionEvent{Data: &SessionIdleData{}}

Calls 2

processEventsMethod · 0.95
closeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…