(t *testing.T)
| 151 | } |
| 152 | |
| 153 | func TestAddPackageNull(t *testing.T) { |
| 154 | in, want := parseConfigTxtarTest(t, ` |
| 155 | -- in -- |
| 156 | { "packages": null } |
| 157 | -- want -- |
| 158 | { |
| 159 | "packages": { |
| 160 | "go": "latest" |
| 161 | } |
| 162 | }`) |
| 163 | |
| 164 | in.PackagesMutator.Add("go@latest") |
| 165 | if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" { |
| 166 | t.Errorf("wrong parsed config json (-want +got):\n%s", diff) |
| 167 | } |
| 168 | if diff := cmp.Diff(want, in.Bytes()); diff != "" { |
| 169 | t.Errorf("wrong raw config hujson (-want +got):\n%s", diff) |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | func TestAddPackageObject(t *testing.T) { |
| 174 | in, want := parseConfigTxtarTest(t, ` |
nothing calls this directly
no test coverage detected