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

Function TestUpdateNewCurrentSysInfoIsAdded

internal/devbox/update_test.go:30–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestUpdateNewCurrentSysInfoIsAdded(t *testing.T) {
31 devbox := devboxForTesting(t)
32
33 raw := "hello@1.2.3"
34 sys := currentSystem(t)
35 devPkg := devpkg.PackageFromStringWithDefaults(raw, nil)
36 resolved := &lock.Package{
37 Resolved: "resolved-flake-reference",
38 Systems: map[string]*lock.SystemInfo{
39 sys: {
40 Outputs: []lock.Output{
41 {
42 Name: "out",
43 Default: true,
44 Path: "store_path1",
45 },
46 },
47 },
48 },
49 }
50 lockfile := &lock.File{
51 Packages: map[string]*lock.Package{
52 raw: {
53 Resolved: "resolved-flake-reference",
54 // No system infos.
55 },
56 },
57 }
58
59 err := devbox.mergeResolvedPackageToLockfile(devPkg, resolved, lockfile)
60 require.NoError(t, err, "update failed")
61
62 require.Contains(t, lockfile.Packages, raw)
63 require.Contains(t, lockfile.Packages[raw].Systems, sys)
64 require.Equal(t, "store_path1", lockfile.Packages[raw].Systems[sys].Outputs[0].Path)
65}
66
67func TestUpdateNewSysInfoIsAdded(t *testing.T) {
68 devbox := devboxForTesting(t)

Callers

nothing calls this directly

Calls 4

devboxForTestingFunction · 0.85
currentSystemFunction · 0.85

Tested by

no test coverage detected