TestHandleRootError_BareErrorExitCodeNoStderr pins the silent-exit contract: a *output.BareError is honored for its exit code while stderr stays empty (stdout already carries the result, so the dispatcher must not layer a second envelope on top).
(t *testing.T)
| 460 | // empty (stdout already carries the result, so the dispatcher must not layer a |
| 461 | // second envelope on top). |
| 462 | func TestHandleRootError_BareErrorExitCodeNoStderr(t *testing.T) { |
| 463 | t.Setenv("LARKSUITE_CLI_CONFIG_DIR", t.TempDir()) |
| 464 | |
| 465 | f, _, _, _ := cmdutil.TestFactory(t, nil) |
| 466 | errOut := &bytes.Buffer{} |
| 467 | f.IOStreams.ErrOut = errOut |
| 468 | |
| 469 | exit := handleRootError(f, output.ErrBare(output.ExitAuth)) |
| 470 | if exit != int(output.ExitAuth) { |
| 471 | t.Errorf("exit = %d, want %d (BareError code propagated)", exit, int(output.ExitAuth)) |
| 472 | } |
| 473 | if errOut.Len() != 0 { |
| 474 | t.Errorf("stderr must stay empty for a bare predicate signal, got:\n%s", errOut.String()) |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | // TestHandleRootError_TypedAuthErrorWithLegacyCausePreserved pins that a typed |
| 479 | // *errs.AuthenticationError carrying a legacy *NeedAuthorizationError in its |
nothing calls this directly
no test coverage detected