(t *testing.T)
| 457 | } |
| 458 | |
| 459 | func TestHashExternalTask_Deterministic(t *testing.T) { |
| 460 | ext := ExternalTask{ |
| 461 | ExternalID: "1", |
| 462 | Title: "Test", |
| 463 | Description: "Desc", |
| 464 | Status: "open", |
| 465 | Priority: "high", |
| 466 | Assignee: "alice", |
| 467 | Labels: []string{"bug"}, |
| 468 | URL: "https://example.com", |
| 469 | } |
| 470 | |
| 471 | h1 := HashExternalTask(ext) |
| 472 | h2 := HashExternalTask(ext) |
| 473 | |
| 474 | if h1 != h2 { |
| 475 | t.Errorf("hash not deterministic: %s != %s", h1, h2) |
| 476 | } |
| 477 | |
| 478 | // Different task should have different hash |
| 479 | ext.Title = "Different" |
| 480 | h3 := HashExternalTask(ext) |
| 481 | if h1 == h3 { |
| 482 | t.Error("expected different hash for different task") |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | func TestHashExternalTask_SensitiveToAllFields(t *testing.T) { |
| 487 | base := ExternalTask{ |
nothing calls this directly
no test coverage detected