morning, routine: reject the two configs that silently do nothing (V-581)
Both Due functions key their last-fired map by routine name, so two routines sharing a name took turns suppressing each other and one of them never fired. Validate now rejects a duplicate name in either package. parseHHMM checked the digits arithmetically, which let a stray character cancel out: window_start of 2 :00 loaded as 04:00 and passed the validation that exists to catch that typo. Each of the four positions is now checked as a digit, which makes the negative bounds unreachable and they are gone. Folded the three copies of the unevidenced-item loop in Evaluate, Outstanding and Due into one helper.
This commit is contained in:
@@ -60,6 +60,12 @@ func TestValidate(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Due keys its last-fired map by name, so two routines sharing one would
|
||||
// take turns being suppressed by the other's fire.
|
||||
if err := Validate(append(ok, ok[0])); err == nil {
|
||||
t.Error("expected an error for a duplicate name, got nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDue(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user