(t *testing.T)
| 420 | } |
| 421 | |
| 422 | func TestRunJSONShellHookUsesRuntimeStderr(t *testing.T) { |
| 423 | command := "cat" |
| 424 | if os.PathSeparator == '\\' { |
| 425 | command = "more" |
| 426 | } |
| 427 | var diagnostics bytes.Buffer |
| 428 | ctx := newCmdRuntimeOutputContext(t, io.Discard, &diagnostics) |
| 429 | if err := runJSONShellHook(ctx, command, map[string]any{"event": "changed"}); err != nil { |
| 430 | t.Fatalf("runJSONShellHook: %v", err) |
| 431 | } |
| 432 | if got := diagnostics.String(); !strings.Contains(got, `"event":"changed"`) { |
| 433 | t.Fatalf("unexpected hook output: %q", got) |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | func newDrivePollTestContext(t *testing.T, svc *drive.Service, stdout io.Writer) context.Context { |
| 438 | t.Helper() |
nothing calls this directly
no test coverage detected