MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / test_termios_drain

Function test_termios_drain

tests/termios/termios.rs:24–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23#[test]
24fn test_termios_drain() {
25 use rustix::pty::*;
26 use rustix::termios::*;
27
28 let pty = match openpt(OpenptFlags::empty()) {
29 Ok(pty) => pty,
30 Err(rustix::io::Errno::NOSYS) => return,
31 Err(err) => panic!("{:?}", err),
32 };
33 let tio = match tcgetattr(&pty) {
34 Ok(tio) => tio,
35 Err(rustix::io::Errno::NOSYS) => return,
36 #[cfg(apple)]
37 Err(rustix::io::Errno::NOTTY) => return,
38 Err(err) => panic!("{:?}", err),
39 };
40 tcsetattr(&pty, OptionalActions::Now, &tio).unwrap();
41
42 tcdrain(&pty).unwrap();
43}
44
45#[test]
46fn test_termios_winsize() {

Callers

nothing calls this directly

Calls 4

openptFunction · 0.50
tcgetattrFunction · 0.50
tcsetattrFunction · 0.50
tcdrainFunction · 0.50

Tested by

no test coverage detected