chore: restore product scaffold to rollback baseline

This commit is contained in:
Edison Jwa
2026-05-29 14:02:04 +09:00
parent 2896f14ec9
commit fe6e07353e
434 changed files with 27278 additions and 63230 deletions
+18
View File
@@ -774,6 +774,11 @@ impl ProtocolEventRecorder {
pub fn drain(&mut self) -> Vec<String> {
std::mem::take(&mut self.events)
}
/// Snapshot all recorded events without clearing the buffer.
pub fn snapshot(&self) -> Vec<String> {
self.events.clone()
}
}
impl Default for ProtocolEventRecorder {
@@ -1080,4 +1085,17 @@ mod tests {
"explicit with_android_audio(None) must also omit the section"
);
}
#[test]
fn protocol_event_snapshot_does_not_drain_buffer() {
let mut recorder = ProtocolEventRecorder::new(4);
recorder.record_connected("Server");
let first = recorder.snapshot();
let second = recorder.snapshot();
let drained = recorder.drain();
assert_eq!(first, second);
assert_eq!(drained, first);
}
}