readTestLockfile is a test helper that reads and parses the lockfile from disk.
(t *testing.T, path string)
| 217 | |
| 218 | // readTestLockfile is a test helper that reads and parses the lockfile from disk. |
| 219 | func readTestLockfile(t *testing.T, path string) *file { |
| 220 | t.Helper() |
| 221 | data, err := os.ReadFile(path) |
| 222 | require.NoError(t, err, "lockfile should exist at %s", path) |
| 223 | var f file |
| 224 | require.NoError(t, json.Unmarshal(data, &f)) |
| 225 | return &f |
| 226 | } |
no test coverage detected