Improve the task logic.

This commit is contained in:
Robin Olsen
2026-03-13 11:02:09 +01:00
parent 298c7c540d
commit 010f836df5
2 changed files with 22 additions and 37 deletions

View File

@@ -90,9 +90,10 @@ func (e *Expector) Equal(val, expected any, message string) *Expector {
}
func (e *Expector) Assert(condition bool, message string) *Expector {
check := NewCheck(message, condition)
e.Checks = append(e.Checks, check)
return e
if !condition {
return e.Fail(message)
}
return e.Pass(message + " is correct")
}
func (e *Expector) Nil(value any, message string) *Expector {