11use super :: run_test;
2+ use crate :: assert_datetime_approx_equal;
23use std:: num:: NonZeroUsize ;
34use triagebot:: db:: notifications:: { Identifier , Notification } ;
45
@@ -63,7 +64,7 @@ fn notification() {
6364 notifications[ 0 ] . short_description. as_deref( ) ,
6465 Some ( "Comment on some issue" )
6566 ) ;
66- assert_eq ! ( notifications[ 0 ] . time, now) ;
67+ assert_datetime_approx_equal ( & notifications[ 0 ] . time , & now) ;
6768 assert_eq ! ( notifications[ 0 ] . metadata, None ) ;
6869
6970 assert_eq ! (
@@ -78,7 +79,7 @@ fn notification() {
7879 notifications[ 1 ] . short_description. as_deref( ) ,
7980 Some ( "Comment on some issue" )
8081 ) ;
81- assert_eq ! ( notifications[ 1 ] . time, now) ;
82+ assert_datetime_approx_equal ( & notifications[ 1 ] . time , & now) ;
8283 assert_eq ! ( notifications[ 1 ] . metadata, None ) ;
8384
8485 let notifications = connection. get_notifications ( "weihanglo" ) . await . unwrap ( ) ;
@@ -95,7 +96,7 @@ fn notification() {
9596 notifications[ 0 ] . short_description. as_deref( ) ,
9697 Some ( "Comment on some issue" )
9798 ) ;
98- assert_eq ! ( notifications[ 0 ] . time, now) ;
99+ assert_datetime_approx_equal ( & notifications[ 0 ] . time , & now) ;
99100 assert_eq ! ( notifications[ 0 ] . metadata, None ) ;
100101
101102 let notifications = connection. get_notifications ( "octocat" ) . await . unwrap ( ) ;
0 commit comments