ms-tester/internal/models/result.go
2024-08-18 13:18:00 +05:00

24 lines
558 B
Go

package models
import "time"
type Result int32
const (
Testing Result = 0
NotTested Result = 1
SystemFailDuringTesting Result = 2
TimeLimitExceeded Result = 3
MemoryLimitExceeded Result = 4
CompilationError Result = 5
Accepted Result = 6
)
func (result Result) Valid() error {
switch result {
case NotTested, Accepted, TimeLimitExceeded, MemoryLimitExceede, CompilationError, SystemFailDuringTesting:
return nil
}
return lib.ErrBadResult
}