(t *testing.T)
| 338 | } |
| 339 | |
| 340 | func TestVerifyChecksum_Mismatch(t *testing.T) { |
| 341 | dir := t.TempDir() |
| 342 | filePath := filepath.Join(dir, "binary") |
| 343 | os.WriteFile(filePath, []byte("content"), 0o644) |
| 344 | |
| 345 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 346 | fmt.Fprintf(w, "0000000000000000000000000000000000000000000000000000000000000000 binary\n") |
| 347 | })) |
| 348 | defer srv.Close() |
| 349 | |
| 350 | if err := verifyChecksum(filePath, srv.URL); err == nil { |
| 351 | t.Error("expected checksum verification to fail") |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | func TestPerformUpdate_AlreadyLatest(t *testing.T) { |
| 356 | release := Release{TagName: "v0.5.0"} |
nothing calls this directly
no test coverage detected