Lines
100 %
Functions
Branches
//! PRINT output longer than the guest's staging area reaches the host whole.
use super::*;
async fn output_of(source: &str) -> String {
let mut session = Session::new(ScriptCtx::new(uuid::Uuid::nil())).expect("Session::new");
session.handle_request(source).await.output
}
#[tokio::test]
async fn a_long_message_arrives_whole_and_in_order() {
let text = format!("a{}z", "é".repeat(3000));
let output = output_of(&format!("(print \"{text}\")")).await;
assert!(output.contains(&text), "got {} bytes", output.len());
async fn a_short_message_still_prints() {
assert!(output_of("(print \"hi\")").await.contains("hi"));