undone reptasks dont count towards total in summary
This commit is contained in:
parent
a7a60d1ed2
commit
cbd04cef0a
|
@ -42,7 +42,8 @@ func (ph *processHandler) ProcessLine(line string, indentLevel int, stack []stri
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if todo {
|
// inc count of todo items (rep tasks shouldnt count towards outstanding todo, unless done)
|
||||||
|
if todo && !repTask.Is {
|
||||||
ph.totalCount += 1
|
ph.totalCount += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,10 +53,11 @@ func (ph *processHandler) ProcessLine(line string, indentLevel int, stack []stri
|
||||||
ph.headerPrinted = true
|
ph.headerPrinted = true
|
||||||
}
|
}
|
||||||
ph.doneCount += 1
|
ph.doneCount += 1
|
||||||
// TODO: Math for [x] numXnum
|
|
||||||
repStr := ""
|
repStr := ""
|
||||||
if repTask.Is {
|
if repTask.Is {
|
||||||
repStr = strconv.Itoa( repTask.A * repTask.B)
|
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, " / "))
|
ph.Writeln("\t\t" + repStr + strings.Join(stack, " / "))
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ const EXPECTED = `
|
||||||
not nested
|
not nested
|
||||||
# Repetition
|
# Repetition
|
||||||
25 things
|
25 things
|
||||||
4 / 12
|
4 / 11
|
||||||
`
|
`
|
||||||
|
|
||||||
func TestSummary(t *testing.T) {
|
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))) ])
|
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)
|
t.Errorf("Summary results do not match expected:\nfirst difference at line %v: '%v'\n%v<---->\n%v\n", line, errorStr, string(result), EXPECTED)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue