@@ -87,7 +87,7 @@ async fn test_update_problem_points() {
8787 let pool = utils:: initialize_and_connect_to_test_sql ( ) . await ;
8888 pool. insert_contests ( & [ Contest {
8989 id : contest_id. to_string ( ) ,
90- start_epoch_second : 1468670400 ,
90+ start_epoch_second : 1687608000 , // 2023/06/24 21:00:00 JST
9191 rate_change : "All" . to_string ( ) ,
9292
9393 duration_second : 0 ,
@@ -98,33 +98,42 @@ async fn test_update_problem_points() {
9898
9999 assert ! ( get_points( & pool) . await . is_empty( ) ) ;
100100
101+ // コンテスト開始前の提出
101102 pool. update_submissions ( & [ Submission {
102103 id : 0 ,
103- point : 0 .0,
104+ point : 625 .0, // コンテスト開始前にwriterが設定することがある仮の得点
104105 problem_id : problem_id. to_string ( ) ,
105106 contest_id : contest_id. to_string ( ) ,
107+ epoch_second : 1687208168 , // 2023/06/20 05:56:08 JST
106108 ..Default :: default ( )
107109 } ] )
108110 . await
109111 . 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- ) ;
115112
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+ ] )
123132 . await
124133 . unwrap ( ) ;
125134 pool. update_problem_points ( ) . await . unwrap ( ) ;
126135 assert_eq ! (
127136 get_points( & pool) . await ,
128- vec![ ( "problem" . to_string( ) , Some ( 100 .0) ) ]
137+ vec![ ( "problem" . to_string( ) , Some ( 550 .0) ) ]
129138 ) ;
130139}
0 commit comments