1
1
use super :: run_test;
2
+ use crate :: assert_datetime_approx_equal;
2
3
use std:: num:: NonZeroUsize ;
3
4
use triagebot:: db:: notifications:: { Identifier , Notification } ;
4
5
@@ -63,7 +64,7 @@ fn notification() {
63
64
notifications[ 0 ] . short_description. as_deref( ) ,
64
65
Some ( "Comment on some issue" )
65
66
) ;
66
- assert_eq ! ( notifications[ 0 ] . time, now) ;
67
+ assert_datetime_approx_equal ( & notifications[ 0 ] . time , & now) ;
67
68
assert_eq ! ( notifications[ 0 ] . metadata, None ) ;
68
69
69
70
assert_eq ! (
@@ -78,7 +79,7 @@ fn notification() {
78
79
notifications[ 1 ] . short_description. as_deref( ) ,
79
80
Some ( "Comment on some issue" )
80
81
) ;
81
- assert_eq ! ( notifications[ 1 ] . time, now) ;
82
+ assert_datetime_approx_equal ( & notifications[ 1 ] . time , & now) ;
82
83
assert_eq ! ( notifications[ 1 ] . metadata, None ) ;
83
84
84
85
let notifications = connection. get_notifications ( "weihanglo" ) . await . unwrap ( ) ;
@@ -95,7 +96,7 @@ fn notification() {
95
96
notifications[ 0 ] . short_description. as_deref( ) ,
96
97
Some ( "Comment on some issue" )
97
98
) ;
98
- assert_eq ! ( notifications[ 0 ] . time, now) ;
99
+ assert_datetime_approx_equal ( & notifications[ 0 ] . time , & now) ;
99
100
assert_eq ! ( notifications[ 0 ] . metadata, None ) ;
100
101
101
102
let notifications = connection. get_notifications ( "octocat" ) . await . unwrap ( ) ;
0 commit comments