diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cross_area.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/cross_area.rs b/tests/cross_area.rs index 0ee9aa2b..6f1ab82b 100644 --- a/tests/cross_area.rs +++ b/tests/cross_area.rs @@ -548,6 +548,15 @@ fn decode_frame_payload(payload: &[u8]) -> io::Result<FrameWire> { }) } +fn frame_contains_colored_symbol(frame: &FrameWire, symbol: &str, rgb: (u8, u8, u8)) -> bool { + let (r, g, b) = rgb; + let fg = 0x02_00_00_00 | (u32::from(r) << 16) | (u32::from(g) << 8) | u32::from(b); + frame + .cells + .iter() + .any(|cell| cell.symbol == symbol && cell.fg == fg) +} + fn frame_contains_text(frame: &FrameWire, needle: &str) -> bool { if frame.cells.is_empty() { return false; @@ -836,9 +845,7 @@ fn cross_area_agent_process_survives_detach_and_reattach() { client_handshake(&mut client_b, CURRENT_PROTOCOL, 80, 24); let saw_working_on_client = wait_for_frame_matching(&mut client_b, Duration::from_secs(5), |frame| { - ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"] - .iter() - .any(|symbol| frame_contains_text(frame, symbol)) + frame_contains_colored_symbol(frame, "●", (249, 226, 175)) }) .expect("frame decoding should succeed"); assert!( @@ -857,7 +864,7 @@ fn cross_area_agent_process_survives_detach_and_reattach() { let saw_blocked_on_client = wait_for_frame_matching(&mut client_b, Duration::from_secs(5), |frame| { - frame_contains_text(frame, "◉") + frame_contains_colored_symbol(frame, "●", (243, 139, 168)) }) .expect("frame decoding should succeed"); assert!( |
