(t *testing.T, args []string, runtime *app.Runtime)
| 200 | } |
| 201 | |
| 202 | func executeWithTestRuntime(t *testing.T, args []string, runtime *app.Runtime) executeTestResult { |
| 203 | t.Helper() |
| 204 | |
| 205 | var stdout bytes.Buffer |
| 206 | var stderr bytes.Buffer |
| 207 | if runtime == nil { |
| 208 | runtime = &app.Runtime{} |
| 209 | } else { |
| 210 | runtimeCopy := *runtime |
| 211 | runtime = &runtimeCopy |
| 212 | } |
| 213 | if runtime.KeyringOptions == nil { |
| 214 | runtime.KeyringOptions = testKeyringOptions() |
| 215 | } |
| 216 | runtime.IO = app.IO{ |
| 217 | In: strings.NewReader(""), |
| 218 | Out: &stdout, |
| 219 | Err: &stderr, |
| 220 | } |
| 221 | err := executeWithRuntime(args, runtime) |
| 222 | return executeTestResult{ |
| 223 | stdout: stdout.String(), |
| 224 | stderr: stderr.String(), |
| 225 | err: err, |
| 226 | } |
| 227 | } |
no test coverage detected