File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
1010 "testing"
1111 "testing_system/common/constants/verdict"
1212 "testing_system/lib/customfields"
13+ "time"
1314)
1415
1516func fixtureDb (t * testing.T ) * gorm.DB {
@@ -62,11 +63,29 @@ memory: 5m
6263func TestTestResultsDB (t * testing.T ) {
6364 t .Run ("sqlite" , func (t * testing.T ) {
6465 db := fixtureDb (t )
66+ oneSec := customfields .Time (1 * time .Second )
67+ tenMB := customfields .Memory (10 * 1024 * 1024 )
6568 submission := Submission {
6669 ProblemID : 1 ,
6770 Language : "cpp" ,
6871 Score : 1 ,
6972 Verdict : verdict .TL ,
73+ TestResults : []* TestResult {
74+ {
75+ TestNumber : 1 ,
76+ Points : nil ,
77+ Verdict : verdict .OK ,
78+ Time : & oneSec ,
79+ Memory : & tenMB ,
80+ },
81+ {
82+ TestNumber : 0 ,
83+ Points : nil ,
84+ Verdict : "" ,
85+ Time : & oneSec ,
86+ Memory : & tenMB ,
87+ },
88+ },
7089 }
7190 tx := db .Create (& submission )
7291 require .Nil (t , tx .Error )
You can’t perform that action at this time.
0 commit comments