ms-tester/internal/models/result.go
2024-08-21 03:54:46 +05:00

24 lines
593 B
Go

package models
import "git.sch9.ru/new_gate/ms-tester/internal/lib"
type Result int32
const (
NotTested Result = 0 // change only with schema change
Accepted Result = 1
CompilationError Result = 2
MemoryLimitExceeded Result = 3
TimeLimitExceeded Result = 4
SystemFailDuringTesting Result = 5
Testing Result = 6
)
func (result Result) Valid() error {
switch result {
case NotTested, Accepted, TimeLimitExceeded, MemoryLimitExceeded, CompilationError, SystemFailDuringTesting:
return nil
}
return lib.ErrBadResult
}