Skip to content

Commit d3aeac0

Browse files
dianpopaandreeaflorescu
authored andcommitted
sys_util: fixing test_a_tty terminal unit test
Signed-off-by: Diana Popa <[email protected]>
1 parent 50cab6e commit d3aeac0

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

sys_util/src/terminal.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,8 @@ mod tests {
135135
assert!(stdin.set_raw_mode().is_ok());
136136
assert!(stdin.set_canon_mode().is_ok());
137137
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());
141138
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_eq!(stdin.read_raw(&mut out[..]).unwrap(), 0);
139+
assert!(stdin.read_raw(&mut out[..]).is_ok());
146140
}
147141

148142
#[test]

0 commit comments

Comments
 (0)