(tree *lineTree)
| 26 | } |
| 27 | |
| 28 | func walkLineTree(tree *lineTree) (res []treeNode) { |
| 29 | var walk func(int, *lineTree) |
| 30 | walk = func(initialDepth int, tree *lineTree) { |
| 31 | res = append(res, treeNode{ |
| 32 | childDepth: initialDepth, |
| 33 | line: tree.line, |
| 34 | }) |
| 35 | for i := range tree.children { |
| 36 | walk(initialDepth+1, &tree.children[i]) |
| 37 | } |
| 38 | } |
| 39 | walk(0, tree) |
| 40 | return |
| 41 | } |
| 42 | |
| 43 | func TestFindIndentedParagraph(t *testing.T) { |
| 44 | makeFlattened := func(text, paragraph string) []treeNode { |
no outgoing calls
no test coverage detected