(t *testing.T)
| 232 | } |
| 233 | |
| 234 | func TestExecute_LaunchErrorReturnsDisplayError(t *testing.T) { |
| 235 | t.Parallel() |
| 236 | |
| 237 | wantErr := errors.New("launch failed") |
| 238 | wsl := wsllib.MockWslLib{ |
| 239 | LaunchInteractiveFunc: func(name, command string, inheritPath bool) (uint32, error) { |
| 240 | return 0, wantErr |
| 241 | }, |
| 242 | } |
| 243 | |
| 244 | err := execute(wsl, "Arch", []string{"echo"}) |
| 245 | de := assertDisplayError(t, err) |
| 246 | if !errors.Is(de, wantErr) { |
| 247 | t.Fatalf("wrapped error = %v, want %v", de.Unwrap(), wantErr) |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | func TestExecute_NonZeroExitReturnsExitCodeError(t *testing.T) { |
| 252 | t.Parallel() |
nothing calls this directly
no test coverage detected