MCPcopy Create free account
hub / github.com/emberian/evdev / test_iter_consistency

Function test_iter_consistency

src/sync_stream.rs:946–958  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

944
945 #[test]
946 fn test_iter_consistency() {
947 // once it sees a SYN_DROPPED, it shouldn't mark the block after it as consumed even if we
948 // keep calling the iterator like an idiot
949 let evs = &[KEY4, REPORT, DROPPED, REPORT, KEY4, REPORT, KEY4];
950 let mut range = 0..0;
951 let mut next = || sync_events(&mut range, evs, |_| {});
952 assert_eq!(next(), (Ok(KEY4), Some(2)));
953 assert_eq!(next(), (Ok(REPORT), None));
954 assert_eq!(next(), (Err(true), Some(4)));
955 assert_eq!(next(), (Err(false), None));
956 assert_eq!(next(), (Err(false), None));
957 assert_eq!(next(), (Err(false), None));
958 }
959}

Callers

nothing calls this directly

Calls 1

sync_eventsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…