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

Function TestAddPackageOneLineArray

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

Source from the content-addressed store, hash-verified

243}
244
245func TestAddPackageOneLineArray(t *testing.T) {
246 in, want := parseConfigTxtarTest(t, `
247-- in --
248{
249 "packages": ["go"]
250}
251-- want --
252{
253 "packages": [
254 "go",
255 "python@3.10"
256 ]
257}`)
258
259 in.PackagesMutator.Add("python@3.10")
260 if diff := cmp.Diff(want, in.Bytes(), optParseHujson()); diff != "" {
261 t.Errorf("wrong parsed config json (-want +got):\n%s", diff)
262 }
263 if diff := cmp.Diff(want, in.Bytes()); diff != "" {
264 t.Errorf("wrong raw config hujson (-want +got):\n%s", diff)
265 }
266}
267
268func TestAddPackageMultiLineArray(t *testing.T) {
269 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