(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestParseTaskContent_ValidTask(t *testing.T) { |
| 11 | content := []byte(`--- |
| 12 | id: "001" |
| 13 | title: "Test Task" |
| 14 | status: pending |
| 15 | priority: high |
| 16 | effort: medium |
| 17 | dependencies: ["002", "003"] |
| 18 | tags: |
| 19 | - test |
| 20 | - cli |
| 21 | group: backend |
| 22 | created: 2026-02-08 |
| 23 | --- |
| 24 | |
| 25 | # Test Task |
| 26 | |
| 27 | This is the task body. |
| 28 | |
| 29 | - Item 1 |
| 30 | - Item 2 |
| 31 | `) |
| 32 | |
| 33 | task, err := ParseTaskContent("test.md", content) |
| 34 | if err != nil { |
| 35 | t.Fatalf("expected no error, got: %v", err) |
| 36 | } |
| 37 | |
| 38 | if task.ID != "001" { |
| 39 | t.Errorf("expected ID '001', got '%s'", task.ID) |
| 40 | } |
| 41 | |
| 42 | if task.Title != "Test Task" { |
| 43 | t.Errorf("expected title 'Test Task', got '%s'", task.Title) |
| 44 | } |
| 45 | |
| 46 | if task.Status != model.StatusPending { |
| 47 | t.Errorf("expected status 'pending', got '%s'", task.Status) |
| 48 | } |
| 49 | |
| 50 | if task.Priority != model.PriorityHigh { |
| 51 | t.Errorf("expected priority 'high', got '%s'", task.Priority) |
| 52 | } |
| 53 | |
| 54 | if task.Effort != model.EffortMedium { |
| 55 | t.Errorf("expected effort 'medium', got '%s'", task.Effort) |
| 56 | } |
| 57 | |
| 58 | if len(task.Dependencies) != 2 { |
| 59 | t.Errorf("expected 2 dependencies, got %d", len(task.Dependencies)) |
| 60 | } |
| 61 | |
| 62 | if len(task.Tags) != 2 { |
| 63 | t.Errorf("expected 2 tags, got %d", len(task.Tags)) |
| 64 | } |
| 65 | |
| 66 | if task.Group != "backend" { |
| 67 | t.Errorf("expected group 'backend', got '%s'", task.Group) |
nothing calls this directly
no test coverage detected