(t *testing.T)
| 373 | } |
| 374 | |
| 375 | func TestRemovePackageArray(t *testing.T) { |
| 376 | in, want := parseConfigTxtarTest(t, ` |
| 377 | -- in -- |
| 378 | { |
| 379 | "packages": ["go@latest", "python@3.10"] |
| 380 | } |
| 381 | -- want -- |
| 382 | { |
| 383 | "packages": ["python@3.10"] |
| 384 | }`) |
| 385 | |
| 386 | in.PackagesMutator.Remove("go@latest") |
| 387 | if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" { |
| 388 | t.Errorf("wrong parsed config json (-want +got):\n%s", diff) |
| 389 | } |
| 390 | if diff := cmp.Diff(want, in.Bytes()); diff != "" { |
| 391 | t.Errorf("wrong raw config hujson (-want +got):\n%s", diff) |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | func TestRemovePackageLastElement(t *testing.T) { |
| 396 | in, want := parseConfigTxtarTest(t, ` |
nothing calls this directly
no test coverage detected