@@ -87,7 +87,7 @@ async fn test_update_problem_points() {
87
87
let pool = utils:: initialize_and_connect_to_test_sql ( ) . await ;
88
88
pool. insert_contests ( & [ Contest {
89
89
id : contest_id. to_string ( ) ,
90
- start_epoch_second : 1468670400 ,
90
+ start_epoch_second : 1687608000 , // 2023/06/24 21:00:00 JST
91
91
rate_change : "All" . to_string ( ) ,
92
92
93
93
duration_second : 0 ,
@@ -98,33 +98,42 @@ async fn test_update_problem_points() {
98
98
99
99
assert ! ( get_points( & pool) . await . is_empty( ) ) ;
100
100
101
+ // コンテスト開始前の提出
101
102
pool. update_submissions ( & [ Submission {
102
103
id : 0 ,
103
- point : 0 .0,
104
+ point : 625 .0, // コンテスト開始前にwriterが設定することがある仮の得点
104
105
problem_id : problem_id. to_string ( ) ,
105
106
contest_id : contest_id. to_string ( ) ,
107
+ epoch_second : 1687208168 , // 2023/06/20 05:56:08 JST
106
108
..Default :: default ( )
107
109
} ] )
108
110
. await
109
111
. unwrap ( ) ;
110
- pool. update_problem_points ( ) . await . unwrap ( ) ;
111
- assert_eq ! (
112
- get_points( & pool) . await ,
113
- vec![ ( "problem" . to_string( ) , Some ( 0.0 ) ) ]
114
- ) ;
115
112
116
- pool. update_submissions ( & [ Submission {
117
- id : 1 ,
118
- point : 100.0 ,
119
- problem_id : problem_id. to_string ( ) ,
120
- contest_id : contest_id. to_string ( ) ,
121
- ..Default :: default ( )
122
- } ] )
113
+ // コンテスト開始後の提出
114
+ pool. update_submissions ( & [
115
+ Submission {
116
+ id : 1 ,
117
+ point : 100.0 ,
118
+ problem_id : problem_id. to_string ( ) ,
119
+ contest_id : contest_id. to_string ( ) ,
120
+ epoch_second : 1687608000 , // 2023/07/08 21:00:00 JST
121
+ ..Default :: default ( )
122
+ } ,
123
+ Submission {
124
+ id : 2 ,
125
+ point : 550.0 , // こっちが正式な得点
126
+ problem_id : problem_id. to_string ( ) ,
127
+ contest_id : contest_id. to_string ( ) ,
128
+ epoch_second : 1687608000 , // 2023/07/08 21:00:00 JST
129
+ ..Default :: default ( )
130
+ } ,
131
+ ] )
123
132
. await
124
133
. unwrap ( ) ;
125
134
pool. update_problem_points ( ) . await . unwrap ( ) ;
126
135
assert_eq ! (
127
136
get_points( & pool) . await ,
128
- vec![ ( "problem" . to_string( ) , Some ( 100 .0) ) ]
137
+ vec![ ( "problem" . to_string( ) , Some ( 550 .0) ) ]
129
138
) ;
130
139
}
0 commit comments