(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestParseProgress_BasicStory(t *testing.T) { |
| 11 | tmpDir := t.TempDir() |
| 12 | path := filepath.Join(tmpDir, "progress.md") |
| 13 | |
| 14 | content := `## 2026-02-20 - US-001 |
| 15 | - Created parser at lib/Parser.php |
| 16 | - Added 10 unit tests |
| 17 | --- |
| 18 | ` |
| 19 | if err := os.WriteFile(path, []byte(content), 0644); err != nil { |
| 20 | t.Fatalf("failed to write test file: %v", err) |
| 21 | } |
| 22 | |
| 23 | entries, err := ParseProgress(path) |
| 24 | if err != nil { |
| 25 | t.Fatalf("ParseProgress failed: %v", err) |
| 26 | } |
| 27 | |
| 28 | if len(entries["US-001"]) != 1 { |
| 29 | t.Fatalf("expected 1 entry for US-001, got %d", len(entries["US-001"])) |
| 30 | } |
| 31 | |
| 32 | entry := entries["US-001"][0] |
| 33 | if entry.Date != "2026-02-20" { |
| 34 | t.Errorf("expected date '2026-02-20', got '%s'", entry.Date) |
| 35 | } |
| 36 | if entry.StoryID != "US-001" { |
| 37 | t.Errorf("expected story ID 'US-001', got '%s'", entry.StoryID) |
| 38 | } |
| 39 | if !strings.Contains(entry.Content, "Created parser at lib/Parser.php") { |
| 40 | t.Errorf("expected content to contain first bullet, got: %s", entry.Content) |
| 41 | } |
| 42 | if !strings.Contains(entry.Content, "Added 10 unit tests") { |
| 43 | t.Errorf("expected content to contain second bullet, got: %s", entry.Content) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func TestParseProgress_MultipleStories(t *testing.T) { |
| 48 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected