aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/private.rs4
-rw-r--r--tests/input.rs52
2 files changed, 16 insertions, 40 deletions
diff --git a/src/private.rs b/src/private.rs
index 6bb37a9..0b5d2f2 100644
--- a/src/private.rs
+++ b/src/private.rs
@@ -65,9 +65,9 @@ pub trait Input {
&& !self.should_parse_special_keys()
}
28..=31 => true,
- 32..=126 => true,
+ 32..=126 => !self.should_parse_utf8(),
127 => !self.should_parse_special_keys(),
- 128..=255 => true,
+ 128..=255 => !self.should_parse_utf8(),
})
.collect();
if !prefix.is_empty() {
diff --git a/tests/input.rs b/tests/input.rs
index 79aaea7..b1607bf 100644
--- a/tests/input.rs
+++ b/tests/input.rs
@@ -144,44 +144,20 @@ fn run_input_test(
}
} else {
if utf8 {
- // assert_eq!(
- // std::string::String::from_utf8(fixtures::read_line(
- // &mut r
- // ))
- // .unwrap(),
- // "Bytes([27]): [27]\r\n"
- // );
- // assert_eq!(
- // std::string::String::from_utf8(fixtures::read_line(
- // &mut r
- // ))
- // .unwrap(),
- // "String(\"[A\"): [91, 65]\r\n"
- // );
- if meta {
- assert_eq!(
- std::string::String::from_utf8(
- fixtures::read_line(&mut r)
- )
- .unwrap(),
- "Bytes([27]): [27]\r\n"
- );
- assert_eq!(
- std::string::String::from_utf8(
- fixtures::read_line(&mut r)
- )
- .unwrap(),
- "String(\"[A\"): [91, 65]\r\n"
- );
- } else {
- assert_eq!(
- std::string::String::from_utf8(
- fixtures::read_line(&mut r)
- )
- .unwrap(),
- "Bytes([27, 91, 65]): [27, 91, 65]\r\n"
- );
- }
+ assert_eq!(
+ std::string::String::from_utf8(fixtures::read_line(
+ &mut r
+ ))
+ .unwrap(),
+ "Bytes([27]): [27]\r\n"
+ );
+ assert_eq!(
+ std::string::String::from_utf8(fixtures::read_line(
+ &mut r
+ ))
+ .unwrap(),
+ "String(\"[A\"): [91, 65]\r\n"
+ );
} else {
if meta {
assert_eq!(