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

Function TestRemovePackageObject

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

Source from the content-addressed store, hash-verified

324}
325
326func TestRemovePackageObject(t *testing.T) {
327 in, want := parseConfigTxtarTest(t, `
328-- in --
329{
330 "packages": {
331 "go": "latest",
332 "python": "3.10"
333 }
334}
335-- want --
336{
337 "packages": {
338 "python": "3.10"
339 }
340}`)
341
342 in.PackagesMutator.Remove("go@latest")
343 if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" {
344 t.Errorf("wrong parsed config json (-want +got):\n%s", diff)
345 }
346 if diff := cmp.Diff(want, in.Bytes()); diff != "" {
347 t.Errorf("wrong raw config hujson (-want +got):\n%s", diff)
348 }
349}
350
351func TestRemovePackageLastMember(t *testing.T) {
352 in, want := parseConfigTxtarTest(t, `

Callers

nothing calls this directly

Calls 4

parseConfigTxtarTestFunction · 0.85
optParseHujsonFunction · 0.85
BytesMethod · 0.80
RemoveMethod · 0.45

Tested by

no test coverage detected