MCPcopy Create free account
hub / github.com/alecthomas/devtodo2 / TestFind

Function TestFind

todo_test.go:23–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func TestFind(t *testing.T) {
24 tasks := NewTaskList()
25 tasks.Create("do A", MEDIUM)
26 b := tasks.Create("do B", MEDIUM)
27 b.Create("do C", MEDIUM)
28 b.Create("do D", MEDIUM)
29
30 task := tasks.Find("2.2")
31 if task == nil || task.Text() != "do D" {
32 t.Fail()
33 }
34}
35
36func TestIndexFromString(t *testing.T) {
37 index := indexFromString("1.2.3")

Callers

nothing calls this directly

Calls 4

FindMethod · 0.95
NewTaskListFunction · 0.85
CreateMethod · 0.65
TextMethod · 0.65

Tested by

no test coverage detected