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

Function TestAddPackageNull

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

Source from the content-addressed store, hash-verified

151}
152
153func 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
173func TestAddPackageObject(t *testing.T) {
174 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