diff --git a/mdbj-summary/summary.go b/mdbj-summary/summary.go index 3f0f1f4..ff9cbd5 100644 --- a/mdbj-summary/summary.go +++ b/mdbj-summary/summary.go @@ -42,7 +42,8 @@ func (ph *processHandler) ProcessLine(line string, indentLevel int, stack []stri return } - if todo { + // inc count of todo items (rep tasks shouldnt count towards outstanding todo, unless done) + if todo && !repTask.Is { ph.totalCount += 1 } @@ -52,10 +53,11 @@ func (ph *processHandler) ProcessLine(line string, indentLevel int, stack []stri ph.headerPrinted = true } ph.doneCount += 1 - // TODO: Math for [x] numXnum repStr := "" if repTask.Is { repStr = strconv.Itoa( repTask.A * repTask.B) + // inc todo count here since we did a thing, its done, and we dont want a higher done count than total + ph.totalCount += 1 } ph.Writeln("\t\t" + repStr + strings.Join(stack, " / ")) } diff --git a/mdbj-summary/summary_test.go b/mdbj-summary/summary_test.go index c40d76d..3eac167 100644 --- a/mdbj-summary/summary_test.go +++ b/mdbj-summary/summary_test.go @@ -18,7 +18,7 @@ const EXPECTED = ` not nested # Repetition 25 things -4 / 12 +4 / 11 ` func TestSummary(t *testing.T) { @@ -55,6 +55,5 @@ func TestSummary(t *testing.T) { errorStr := string(result[int(math.Max(0, float64(diffLoc - 10))) : int(math.Min(float64(len(result)), float64(diffLoc + 10))) ]) t.Errorf("Summary results do not match expected:\nfirst difference at line %v: '%v'\n%v<---->\n%v\n", line, errorStr, string(result), EXPECTED) - } }