(t *testing.T)
| 87 | } |
| 88 | |
| 89 | func TestAddPackageEmptyConfig(t *testing.T) { |
| 90 | in, want := parseConfigTxtarTest(t, ` |
| 91 | -- in -- |
| 92 | {} |
| 93 | -- want -- |
| 94 | { |
| 95 | "packages": { |
| 96 | "go": "latest" |
| 97 | } |
| 98 | }`) |
| 99 | |
| 100 | in.PackagesMutator.Add("go@latest") |
| 101 | if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" { |
| 102 | t.Errorf("wrong parsed config json (-want +got):\n%s", diff) |
| 103 | } |
| 104 | if diff := cmp.Diff(want, in.Bytes()); diff != "" { |
| 105 | t.Errorf("wrong raw config hujson (-want +got):\n%s", diff) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func TestAddPackageEmptyConfigWhitespace(t *testing.T) { |
| 110 | in, want := parseConfigTxtarTest(t, ` |
nothing calls this directly
no test coverage detected