(t *testing.T)
| 234 | } |
| 235 | |
| 236 | func TestFlakeUpdateRewritesLockEntry(t *testing.T) { |
| 237 | devbox := devboxForTesting(t) |
| 238 | |
| 239 | raw := "github:numtide/flake-utils" |
| 240 | devPkg := devpkg.PackageFromStringWithDefaults(raw, devbox.lockfile) |
| 241 | oldRev := "1111111111111111111111111111111111111111" |
| 242 | newRev := "2222222222222222222222222222222222222222" |
| 243 | existing := &lock.Package{ |
| 244 | Resolved: "github:numtide/flake-utils/" + oldRev, |
| 245 | LastModified: "2024-01-01T00:00:00Z", |
| 246 | } |
| 247 | resolved := &lock.Package{ |
| 248 | Resolved: "github:numtide/flake-utils/" + newRev, |
| 249 | LastModified: "2025-04-22T00:00:00Z", |
| 250 | } |
| 251 | lockfile := &lock.File{ |
| 252 | Packages: map[string]*lock.Package{raw: existing}, |
| 253 | } |
| 254 | |
| 255 | err := devbox.mergeResolvedPackageToLockfile(devPkg, resolved, lockfile) |
| 256 | require.NoError(t, err) |
| 257 | require.Equal(t, "github:numtide/flake-utils/"+newRev, lockfile.Packages[raw].Resolved) |
| 258 | require.Equal(t, "2025-04-22T00:00:00Z", lockfile.Packages[raw].LastModified) |
| 259 | } |
| 260 | |
| 261 | func TestFlakeUpdateStalenessGuardRejectsOlder(t *testing.T) { |
| 262 | devbox := devboxForTesting(t) |
nothing calls this directly
no test coverage detected