(t *testctx.T, lockBytes []byte, operation string, expectedInputs []any, expectedPolicy workspace.LockPolicy)
| 528 | } |
| 529 | |
| 530 | func assertGitLockEntry(t *testctx.T, lockBytes []byte, operation string, expectedInputs []any, expectedPolicy workspace.LockPolicy) { |
| 531 | t.Helper() |
| 532 | parsed, err := lockfile.Parse(lockBytes) |
| 533 | require.NoError(t, err) |
| 534 | |
| 535 | var found bool |
| 536 | for _, entry := range parsed.Entries() { |
| 537 | if entry.Namespace != "" || entry.Operation != operation { |
| 538 | continue |
| 539 | } |
| 540 | if !equalLockInputs(entry.Inputs, expectedInputs) { |
| 541 | continue |
| 542 | } |
| 543 | |
| 544 | found = true |
| 545 | require.Equal(t, string(expectedPolicy), entry.Policy) |
| 546 | |
| 547 | value, ok := entry.Value.(string) |
| 548 | require.True(t, ok) |
| 549 | require.True(t, len(value) == 40 || strings.HasPrefix(value, "sha256:")) |
| 550 | } |
| 551 | |
| 552 | require.True(t, found, "expected %s entry in lockfile", operation) |
| 553 | } |
| 554 | |
| 555 | func assertModuleResolveLockEntry(t *testctx.T, lockBytes []byte, source string, expectedPolicy workspace.LockPolicy) { |
| 556 | t.Helper() |
no test coverage detected