(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func TestTaskConfirmPromptDeny(t *testing.T) { |
| 116 | tempXDGStateDir(t) |
| 117 | |
| 118 | task := &testTask{ |
| 119 | RunFunc: func(ctx context.Context) error { return nil }, |
| 120 | NeedsRunFunc: func(context.Context, RunInfo) bool { return true }, |
| 121 | } |
| 122 | |
| 123 | setPromptResponse(t, false) |
| 124 | err := ConfirmRun(t.Context(), t.Name(), task, "continue?") |
| 125 | if err == nil { |
| 126 | t.Error("got nil error, want ErrUserRefused") |
| 127 | } else if !errors.Is(err, ErrUserRefused) { |
| 128 | t.Error("got errors.Is(err, ErrUserRefused) == false for error:", err) |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | // TestSudoDevbox uses sudo on the current test binary to recursively call |
| 133 | // itself as root. This test can only be run manually (because it needs sudo) |
nothing calls this directly
no test coverage detected