@@ -87,23 +87,24 @@ fn missing_contract_returns_none() {
8787
8888#[ test]
8989fn review_ats_in_week_filters_group_and_range ( ) {
90- // Arrange:两组各一卡;本周 3 次复习 + 下周 1 次
90+ // Arrange:两组各一卡;本周 3 次复习 + 下周 1 次(reviewed_at 为毫秒口径)
9191 let db = mem_db ( ) ;
9292 let g1 = make_group ( & db, "组一" ) ;
9393 let g2 = make_group ( & db, "组二" ) ;
9494 let card1 = make_card ( & db, g1. id , "卡一" ) ;
9595 let card2 = make_card ( & db, g2. id , "卡二" ) ;
9696 let ws = week_start_secs ( 1_767_225_600 ) ;
97- db. add_review_log ( card1. id , "good" , ws + 3_600 ) . expect ( "r1" ) ; // 本周
98- db. add_review_log ( card1. id , "good" , ws + 86_400 ) . expect ( "r2" ) ; // 本周
99- db. add_review_log ( card2. id , "easy" , ws + 43_200 ) . expect ( "r3" ) ; // 本周·他组
100- db. add_review_log ( card1. id , "again" , ws + 604_800 + 100 ) . expect ( "r4" ) ; // 下周
97+ let ws_ms = ws * 1000 ;
98+ db. add_review_log ( card1. id , "good" , ws_ms + 3_600_000 ) . expect ( "r1" ) ; // 本周
99+ db. add_review_log ( card1. id , "good" , ws_ms + 86_400_000 ) . expect ( "r2" ) ; // 本周
100+ db. add_review_log ( card2. id , "easy" , ws_ms + 43_200_000 ) . expect ( "r3" ) ; // 本周·他组
101+ db. add_review_log ( card1. id , "again" , ws_ms + 604_800_000 + 100 ) . expect ( "r4" ) ; // 下周
101102 // Act
102103 let ats = db. review_ats_in_week ( g1. id , ws) . expect ( "query" ) ;
103- // Assert:仅组一本周 2 条(下周归下周、他组不计)
104+ // Assert:仅组一本周 2 条(下周归下周、他组不计;返回毫秒原值 )
104105 assert_eq ! ( ats. len( ) , 2 ) ;
105- assert ! ( ats. contains( & ( ws + 3_600 ) ) ) ;
106- assert ! ( ats. contains( & ( ws + 86_400 ) ) ) ;
106+ assert ! ( ats. contains( & ( ws_ms + 3_600_000 ) ) ) ;
107+ assert ! ( ats. contains( & ( ws_ms + 86_400_000 ) ) ) ;
107108}
108109
109110#[ test]
0 commit comments