MCPcopy Index your code
hub / github.com/jetify-com/devbox / assertDevboxJSONPackagesContains

Function assertDevboxJSONPackagesContains

testscripts/testrunner/assert.go:38–61  ·  view source on GitHub ↗
(script *testscript.TestScript, neg bool, args []string)

Source from the content-addressed store, hash-verified

36}
37
38func assertDevboxJSONPackagesContains(script *testscript.TestScript, neg bool, args []string) {
39 if len(args) != 2 {
40 script.Fatalf("usage: devboxjson.packages.contains devbox.json value")
41 }
42
43 data := script.ReadFile(args[0])
44 list := devconfig.Config{}
45 err := json.Unmarshal([]byte(data), &list.Root)
46 script.Check(err)
47
48 expected := args[1]
49 for _, actual := range packagesVersionedNames(list) {
50 if actual == expected {
51 if neg {
52 script.Fatalf("value '%s' found in '%s'", expected, packagesVersionedNames(list))
53 }
54 return
55 }
56 }
57
58 if !neg {
59 script.Fatalf("value '%s' not found in '%s'", expected, packagesVersionedNames(list))
60 }
61}
62
63func assertDevboxLockPackagesContains(script *testscript.TestScript, neg bool, args []string) {
64 if len(args) != 2 {

Callers

nothing calls this directly

Calls 1

packagesVersionedNamesFunction · 0.85

Tested by

no test coverage detected