We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50cab6e commit d3aeac0Copy full SHA for d3aeac0
sys_util/src/terminal.rs
@@ -135,14 +135,8 @@ mod tests {
135
assert!(stdin.set_raw_mode().is_ok());
136
assert!(stdin.set_canon_mode().is_ok());
137
assert!(stdin.set_non_block(true).is_ok());
138
- //trying to read 3 bytes in non-blocking mode will give error as there is nothing to read
139
- let mut out = [0u8; 3];
140
- assert!(stdin.read_raw(&mut out[..]).is_err());
141
let mut out = [0u8; 0];
142
- assert_eq!(stdin.read_raw(&mut out[..]).unwrap(), 0);
143
- assert!(stdin.set_non_block(false).is_ok());
144
- // trying to read more than 0 would block the terminal
145
+ assert!(stdin.read_raw(&mut out[..]).is_ok());
146
}
147
148
#[test]
0 commit comments