MCPcopy Create free account
hub / github.com/jetify-com/devbox / TestAddPackageObject

Function TestAddPackageObject

internal/devconfig/configfile/file_test.go:173–196  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

171}
172
173func 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
198func TestAddPackageObjectComment(t *testing.T) {
199 in, want := parseConfigTxtarTest(t, `

Callers

nothing calls this directly

Calls 4

parseConfigTxtarTestFunction · 0.85
optParseHujsonFunction · 0.85
BytesMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected