about summary refs log tree commit diff
path: root/src/tools/miri/tests/pass/shims/pipe.rs
blob: 4915e54c533f50d39ce3b981008ed149b638e5a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
//@ignore-target: windows

use std::io::{Read, Write, pipe};

fn main() {
    let (mut ping_rx, mut ping_tx) = pipe().unwrap();
    ping_tx.write_all(b"hello").unwrap();
    let mut buf: [u8; 5] = [0; 5];
    ping_rx.read_exact(&mut buf).unwrap();
    assert_eq!(&buf, "hello".as_bytes());
}