improve task logic

This commit is contained in:
Robin Olsen
2026-03-11 20:35:22 +01:00
parent 3f8629ab32
commit a5b04997a7
2 changed files with 32 additions and 53 deletions

View File

@@ -30,11 +30,21 @@ func NewExpector() *Expector {
}
}
func (e *Expector) Valid() bool {
return len(e.Errors()) == 0
}
func (e *Expector) Complete() ValidationFeedback {
e.Success = len(e.Errors()) == 0
return e.ValidationFeedback
}
func (e *Expector) Fatal(message string) ValidationFeedback {
e.Success = false
e.Message = message
return e.ValidationFeedback
}
func (e *Expector) CompleteWithMessage(message string) ValidationFeedback {
e.Success = len(e.Errors()) == 0
if !e.Success {