wsl-clip-core 0.5.1

Core library for wsl-clip clipboard bridge
Documentation
/// Exercises the stdin text path using the mock clipboard sink.
#[test]
fn stdin_text_pipeline_records_in_mock_clipboard() {
    // Enable mock clipboard
    std::env::set_var("WSL_CLIP_TEST_CLIPBOARD_FILE", "1");

    // Simulate the stdin path: start the text stream and write payload
    let mut stream = wsl_clip_core::clipboard::start_text_stream().expect("start stream");
    let payload = b"piped text payload\nsecond line";
    use std::io::Write;
    if let Some(writer) = &mut stream.writer {
        writer.write_all(payload).expect("write payload");
    }
    stream.wait().expect("wait clipboard stream");

    let out = wsl_clip_core::clipboard::read_mock_clipboard().unwrap_or_default();
    assert!(out.contains("piped text payload"));
    assert!(out.contains("second line"));
}