| 1 | #[test] |
| 2 | fn test_termios_flush() { |
| 3 | use rustix::pty::*; |
| 4 | use rustix::termios::*; |
| 5 | |
| 6 | let pty = match openpt(OpenptFlags::empty()) { |
| 7 | Ok(pty) => pty, |
| 8 | Err(rustix::io::Errno::NOSYS) => return, |
| 9 | Err(err) => panic!("{:?}", err), |
| 10 | }; |
| 11 | let tio = match tcgetattr(&pty) { |
| 12 | Ok(tio) => tio, |
| 13 | Err(rustix::io::Errno::NOSYS) => return, |
| 14 | #[cfg(apple)] |
| 15 | Err(rustix::io::Errno::NOTTY) => return, |
| 16 | Err(err) => panic!("{:?}", err), |
| 17 | }; |
| 18 | tcsetattr(&pty, OptionalActions::Now, &tio).unwrap(); |
| 19 | |
| 20 | tcflush(&pty, QueueSelector::IOFlush).unwrap(); |
| 21 | } |
| 22 | |
| 23 | #[test] |
| 24 | fn test_termios_drain() { |