(t *testing.T)
| 171 | } |
| 172 | |
| 173 | func TestAddPackageObject(t *testing.T) { |
| 174 | in, want := parseConfigTxtarTest(t, ` |
| 175 | -- in -- |
| 176 | { |
| 177 | "packages": { |
| 178 | "go": "latest" |
| 179 | } |
| 180 | } |
| 181 | -- want -- |
| 182 | { |
| 183 | "packages": { |
| 184 | "go": "latest", |
| 185 | "python": "3.10" |
| 186 | } |
| 187 | }`) |
| 188 | |
| 189 | in.PackagesMutator.Add("python@3.10") |
| 190 | if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" { |
| 191 | t.Errorf("wrong parsed config json (-want +got):\n%s", diff) |
| 192 | } |
| 193 | if diff := cmp.Diff(want, in.Bytes()); diff != "" { |
| 194 | t.Errorf("wrong raw config hujson (-want +got):\n%s", diff) |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | func TestAddPackageObjectComment(t *testing.T) { |
| 199 | in, want := parseConfigTxtarTest(t, ` |
nothing calls this directly
no test coverage detected