We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f21a254 commit 4138c86Copy full SHA for 4138c86
1 file changed
src/reader.rs
@@ -457,4 +457,16 @@ mod tests {
457
assert_eq!(None, r.try_read());
458
459
}
460
+
461
+ #[test]
462
+ #[should_panic(expected = "is_char_boundary")]
463
+ fn test_try_read_multibyte() {
464
+ // Reproduces the char-boundary panic when the buffer holds a
465
+ // multi-byte UTF-8 char. Filling `buffer` directly keeps the
466
+ // test fully synchronous.
467
+ let f = io::Cursor::new("");
468
+ let mut r = NBReader::new(f, Options::default());
469
+ r.buffer.push_str("\u{c3}\u{83}");
470
+ let _ = r.try_read();
471
+ }
472
0 commit comments