TestCheckReportsUpToDate: local hash matches the manifest → Check returns false. The steady-state path that keeps the spinner quiet after a release.
(t *testing.T)
| 350 | // TestCheckReportsUpToDate: local hash matches the manifest → Check returns |
| 351 | // false. The steady-state path that keeps the spinner quiet after a release. |
| 352 | func TestCheckReportsUpToDate(t *testing.T) { |
| 353 | asset := platformAsset(t) |
| 354 | tmpDir := t.TempDir() |
| 355 | exec := filepath.Join(tmpDir, "codehamr") |
| 356 | body := []byte("running binary content\n") |
| 357 | if err := os.WriteFile(exec, body, 0o755); err != nil { |
| 358 | t.Fatal(err) |
| 359 | } |
| 360 | r := newFakeRelease(t, asset, body, hashOf(body)) |
| 361 | withReleaseURLs(t, r.srv.URL) |
| 362 | t.Setenv("CODEHAMR_NO_UPDATE_CHECK", "") |
| 363 | |
| 364 | if Check(context.Background(), exec) { |
| 365 | t.Fatal("Check should return false when local hash matches published") |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | // TestCheckReportsStale: published hash differs from local → Check returns |
| 370 | // true (update available), driving the maybeSelfUpdate trigger. |
nothing calls this directly
no test coverage detected