ms-tester/internal/models/result.go

24 lines
558 B
Go
Raw Normal View History

2024-08-17 12:23:35 +00:00
package models
import "time"
type Result int32
const (
Testing Result = 0
NotTested Result = 1
SystemFailDuringTesting Result = 2
2024-08-17 13:41:37 +00:00
TimeLimitExceeded Result = 3
MemoryLimitExceeded Result = 4
CompilationError Result = 5
Accepted Result = 6
2024-08-17 12:23:35 +00:00
)
func (result Result) Valid() error {
switch result {
case NotTested, Accepted, TimeLimitExceeded, MemoryLimitExceede, CompilationError, SystemFailDuringTesting:
return nil
}
return lib.ErrBadResult
}