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

Function TestAddPackageEmptyConfig

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

Source from the content-addressed store, hash-verified

87}
88
89func TestAddPackageEmptyConfig(t *testing.T) {
90 in, want := parseConfigTxtarTest(t, `
91-- in --
92{}
93-- want --
94{
95 "packages": {
96 "go": "latest"
97 }
98}`)
99
100 in.PackagesMutator.Add("go@latest")
101 if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" {
102 t.Errorf("wrong parsed config json (-want +got):\n%s", diff)
103 }
104 if diff := cmp.Diff(want, in.Bytes()); diff != "" {
105 t.Errorf("wrong raw config hujson (-want +got):\n%s", diff)
106 }
107}
108
109func TestAddPackageEmptyConfigWhitespace(t *testing.T) {
110 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