(t *testing.T)
| 37 | } |
| 38 | |
| 39 | func TestCheckmake_NoArgsShowsHelp(t *testing.T) { |
| 40 | out := captureOutput(func() { |
| 41 | cmd := newRootCmd() |
| 42 | cmd.SetArgs([]string{}) // no args |
| 43 | err := cmd.Execute() |
| 44 | require.NoError(t, err, "command without args should not fail") |
| 45 | }) |
| 46 | |
| 47 | assert.Contains(t, out, "Usage:", "expected help output to be shown") |
| 48 | assert.Contains(t, out, "checkmake [flags]", "should display root usage line") |
| 49 | } |
| 50 | |
| 51 | func TestCheckmake_VersionOutput(t *testing.T) { |
| 52 | out := captureOutput(func() { |
nothing calls this directly
no test coverage detected