@@ -42,7 +42,7 @@ pub struct SlidingSyncRoom {
42
42
}
43
43
44
44
/// The state of a [`SlidingSyncRoom`].
45
- #[ derive( Debug , Default , Clone ) ]
45
+ #[ derive( Debug , Default , Clone , PartialEq ) ]
46
46
pub enum SlidingSyncRoomState {
47
47
/// The room is not loaded, i.e. not updates have been received yet.
48
48
#[ default]
@@ -274,7 +274,7 @@ mod tests {
274
274
use wiremock:: MockServer ;
275
275
276
276
use super :: * ;
277
- use crate :: { error :: Result , test_utils:: logged_in_client} ;
277
+ use crate :: test_utils:: logged_in_client;
278
278
279
279
macro_rules! room_response {
280
280
( $( $json: tt ) + ) => {
@@ -292,13 +292,18 @@ mod tests {
292
292
}
293
293
294
294
#[ tokio:: test]
295
- async fn test_room_room_id ( ) -> Result < ( ) > {
295
+ async fn test_state ( ) {
296
+ let room = new_room ( room_id ! ( "!foo:bar.org" ) , room_response ! ( { } ) ) . await ;
297
+
298
+ assert_eq ! ( room. state, SlidingSyncRoomState :: NotLoaded ) ;
299
+ }
300
+
301
+ #[ tokio:: test]
302
+ async fn test_room_room_id ( ) {
296
303
let room_id = room_id ! ( "!foo:bar.org" ) ;
297
304
let room = new_room ( room_id, room_response ! ( { } ) ) . await ;
298
305
299
306
assert_eq ! ( room. room_id( ) , room_id) ;
300
-
301
- Ok ( ( ) )
302
307
}
303
308
304
309
macro_rules! test_getters {
@@ -313,7 +318,7 @@ mod tests {
313
318
) => {
314
319
$(
315
320
#[ tokio:: test]
316
- async fn $test_name ( ) -> Result < ( ) > {
321
+ async fn $test_name ( ) {
317
322
// Default value.
318
323
{
319
324
let room = new_room( room_id!( "!foo:bar.org" ) , room_response!( { } ) ) . await ;
@@ -339,8 +344,6 @@ mod tests {
339
344
340
345
assert_eq!( room. $getter( ) $( . $getter_field ) ?, $second_value) ;
341
346
}
342
-
343
- Ok ( ( ) )
344
347
}
345
348
) +
346
349
} ;
@@ -397,7 +400,7 @@ mod tests {
397
400
}
398
401
399
402
#[ tokio:: test]
400
- async fn test_required_state ( ) -> Result < ( ) > {
403
+ async fn test_required_state ( ) {
401
404
// Default value.
402
405
{
403
406
let room = new_room ( room_id ! ( "!foo:bar.org" ) , room_response ! ( { } ) ) . await ;
@@ -451,8 +454,6 @@ mod tests {
451
454
452
455
assert ! ( !room. required_state( ) . is_empty( ) ) ;
453
456
}
454
-
455
- Ok ( ( ) )
456
457
}
457
458
458
459
#[ test]
0 commit comments