(t *testing.T)
| 324 | } |
| 325 | |
| 326 | func TestRemovePackageObject(t *testing.T) { |
| 327 | in, want := parseConfigTxtarTest(t, ` |
| 328 | -- in -- |
| 329 | { |
| 330 | "packages": { |
| 331 | "go": "latest", |
| 332 | "python": "3.10" |
| 333 | } |
| 334 | } |
| 335 | -- want -- |
| 336 | { |
| 337 | "packages": { |
| 338 | "python": "3.10" |
| 339 | } |
| 340 | }`) |
| 341 | |
| 342 | in.PackagesMutator.Remove("go@latest") |
| 343 | if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" { |
| 344 | t.Errorf("wrong parsed config json (-want +got):\n%s", diff) |
| 345 | } |
| 346 | if diff := cmp.Diff(want, in.Bytes()); diff != "" { |
| 347 | t.Errorf("wrong raw config hujson (-want +got):\n%s", diff) |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | func TestRemovePackageLastMember(t *testing.T) { |
| 352 | in, want := parseConfigTxtarTest(t, ` |
nothing calls this directly
no test coverage detected