MCPcopy Create free account
hub / github.com/driangle/taskmd / TestHashExternalTask_Deterministic

Function TestHashExternalTask_Deterministic

apps/cli/internal/sync/engine_test.go:459–484  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

457}
458
459func 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
486func TestHashExternalTask_SensitiveToAllFields(t *testing.T) {
487 base := ExternalTask{

Callers

nothing calls this directly

Calls 2

HashExternalTaskFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected