a789495a98
FreeBSD Smoke / FreeBSD Smoke (x86_64) (push) Has been cancelled
CI / Quality Guardrails (push) Has been cancelled
CI / Build & Test (macos-latest) (push) Has been cancelled
CI / Build & Test (ubuntu-latest) (push) Has been cancelled
CI / Build & Test (windows-latest) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / PowerShell Syntax (push) Has been cancelled
CI / Windows Cross-Target Check (Linux) (push) Has been cancelled
65 lines
1.9 KiB
Rust
65 lines
1.9 KiB
Rust
use crate::test_support::*;
|
|
|
|
#[tokio::test]
|
|
async fn test_websocket_transport_matches_unix_socket_for_subscribe_history_message_and_resume()
|
|
-> Result<()> {
|
|
let _env = setup_test_env()?;
|
|
let unix = run_unix_transport_scenario().await?;
|
|
let websocket = run_websocket_transport_scenario().await?;
|
|
|
|
assert!(
|
|
unix.subscribe_events
|
|
.iter()
|
|
.any(|event| matches!(event, ServerEvent::Ack { id } if *id == 1))
|
|
);
|
|
assert!(
|
|
unix.subscribe_events
|
|
.iter()
|
|
.any(|event| matches!(event, ServerEvent::Done { id } if *id == 1))
|
|
);
|
|
assert!(
|
|
websocket
|
|
.subscribe_events
|
|
.iter()
|
|
.any(|event| matches!(event, ServerEvent::Ack { id } if *id == 1))
|
|
);
|
|
assert!(
|
|
websocket
|
|
.subscribe_events
|
|
.iter()
|
|
.any(|event| matches!(event, ServerEvent::Done { id } if *id == 1))
|
|
);
|
|
|
|
let unix_history = unix
|
|
.history_events
|
|
.iter()
|
|
.find_map(summarize_history_invariant)
|
|
.ok_or_else(|| anyhow::anyhow!("missing unix history event"))?;
|
|
let websocket_history = websocket
|
|
.history_events
|
|
.iter()
|
|
.find_map(summarize_history_invariant)
|
|
.ok_or_else(|| anyhow::anyhow!("missing websocket history event"))?;
|
|
assert_eq!(
|
|
unix_history, websocket_history,
|
|
"history payload should match across transports"
|
|
);
|
|
|
|
let unix_resume = unix
|
|
.resume_events
|
|
.iter()
|
|
.find_map(summarize_history_invariant)
|
|
.ok_or_else(|| anyhow::anyhow!("missing unix resume history event"))?;
|
|
let websocket_resume = websocket
|
|
.resume_events
|
|
.iter()
|
|
.find_map(summarize_history_invariant)
|
|
.ok_or_else(|| anyhow::anyhow!("missing websocket resume history event"))?;
|
|
assert_eq!(
|
|
unix_resume, websocket_resume,
|
|
"resume history payload should match across transports"
|
|
);
|
|
|
|
Ok(())
|
|
}
|