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

Function TestParseTaskContent_ValidTask

sdk/go/parser/markdown_test.go:10–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestParseTaskContent_ValidTask(t *testing.T) {
11 content := []byte(`---
12id: "001"
13title: "Test Task"
14status: pending
15priority: high
16effort: medium
17dependencies: ["002", "003"]
18tags:
19 - test
20 - cli
21group: backend
22created: 2026-02-08
23---
24
25# Test Task
26
27This 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)

Callers

nothing calls this directly

Calls 2

ParseTaskContentFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected