MCPcopy Index your code
hub / github.com/coder/coder / tGo

Function tGo

cli/ssh_test.go:2480–2493  ·  view source on GitHub ↗

tGo runs fn in a goroutine and waits until fn has completed before test completion. Done is returned for optionally waiting for fn to exit. NOTE(mafredri): This could be moved to a helper library.

(t *testing.T, fn func())

Source from the content-addressed store, hash-verified

2478//
2479// NOTE(mafredri): This could be moved to a helper library.
2480func tGo(t *testing.T, fn func()) (done <-chan struct{}) {
2481 t.Helper()
2482
2483 doneC := make(chan struct{})
2484 t.Cleanup(func() {
2485 <-doneC
2486 })
2487 go func() {
2488 fn()
2489 close(doneC)
2490 }()
2491
2492 return doneC
2493}
2494
2495func TestSSH_Completion(t *testing.T) {
2496 t.Parallel()

Callers 10

TestSpeedtestFunction · 0.85
TestSpeedtestJsonFunction · 0.85
TestExpRptyFunction · 0.85
TestDERPHeadersFunction · 0.85
TestSSHFunction · 0.85
TestSSH_ForwardGPGFunction · 0.85
TestSSH_ContainerFunction · 0.85
TestSSH_CoderConnectFunction · 0.85
TestPingFunction · 0.85

Calls 2

HelperMethod · 0.65
CleanupMethod · 0.65

Tested by

no test coverage detected