Commit 56f61c8ae6
Unsigned
Layout: unified · split
src/room/mod.rs +13 −18
| @@ -105,24 +105,6 @@ fn restored_prev_batch(prev_batch: Option<String>) -> Option<PrevBatch> { | ||
| 105 | 105 | prev_batch.map(PrevBatch::Backwards) |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | #[cfg(test)] | |
| 109 | mod tests { | |
| 110 | use super::{restored_prev_batch, PrevBatch}; | |
| 111 | ||
| 112 | #[test] | |
| 113 | fn restored_rooms_fetch_history_backwards_from_prev_batch() { | |
| 114 | assert_eq!( | |
| 115 | restored_prev_batch(Some("token".to_owned())), | |
| 116 | Some(PrevBatch::Backwards("token".to_owned())) | |
| 117 | ); | |
| 118 | } | |
| 119 | ||
| 120 | #[test] | |
| 121 | fn restored_rooms_without_prev_batch_have_no_history_request() { | |
| 122 | assert_eq!(restored_prev_batch(None), None); | |
| 123 | } | |
| 124 | } | |
| 125 | ||
| 126 | 108 | impl Deref for RoomHandle { |
| 127 | 109 | type Target = MatrixRoom; |
| 128 | 110 | |
| @@ -1384,6 +1366,19 @@ mod tests { | ||
| 1384 | 1366 | RoomMessageEventContent::text_plain(body) |
| 1385 | 1367 | } |
| 1386 | 1368 | |
| 1369 | #[test] | |
| 1370 | fn restored_rooms_fetch_history_backwards_from_prev_batch() { | |
| 1371 | assert_eq!( | |
| 1372 | restored_prev_batch(Some("token".to_owned())), | |
| 1373 | Some(PrevBatch::Backwards("token".to_owned())) | |
| 1374 | ); | |
| 1375 | } | |
| 1376 | ||
| 1377 | #[test] | |
| 1378 | fn restored_rooms_without_prev_batch_have_no_history_request() { | |
| 1379 | assert_eq!(restored_prev_batch(None), None); | |
| 1380 | } | |
| 1381 | ||
| 1387 | 1382 | #[test] |
| 1388 | 1383 | fn transaction_event_without_id_renders_normally() { |
| 1389 | 1384 | let queue = MessageQueue::new(); |