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

Function TestAddPackageEmptyArray

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

Source from the content-addressed store, hash-verified

223}
224
225func TestAddPackageEmptyArray(t *testing.T) {
226 in, want := parseConfigTxtarTest(t, `
227-- in --
228{
229 "packages": []
230}
231-- want --
232{
233 "packages": ["go@latest"]
234}`)
235
236 in.PackagesMutator.Add("go@latest")
237 if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" {
238 t.Errorf("wrong parsed config json (-want +got):\n%s", diff)
239 }
240 if diff := cmp.Diff(want, in.Bytes()); diff != "" {
241 t.Errorf("wrong raw config hujson (-want +got):\n%s", diff)
242 }
243}
244
245func TestAddPackageOneLineArray(t *testing.T) {
246 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