MCPcopy Create free account
hub / github.com/google/gapid / TestCommandCancel

Function TestCommandCancel

core/os/shell/command_test.go:57–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestCommandCancel(t *testing.T) {
58 ctx := log.Testing(t)
59 child, cancel := task.WithCancel(ctx)
60 cancel()
61 err := shell.Command("sleep", "1").Run(child)
62 assert.For(ctx, "err").ThatError(err).HasMessage(`Process returned error
63 Cause: context canceled`)
64}
65
66func TestCommandCaptureStdout(t *testing.T) {
67 const expect = "echo to stdout\n"

Callers

nothing calls this directly

Calls 5

HasMessageMethod · 0.80
ThatErrorMethod · 0.80
ForMethod · 0.80
RunMethod · 0.65
CommandMethod · 0.65

Tested by

no test coverage detected