We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f21a254 commit 169ea91Copy full SHA for 169ea91
1 file changed
src/reader.rs
@@ -457,4 +457,19 @@ mod tests {
457
assert_eq!(None, r.try_read());
458
459
}
460
+
461
+ // Multi-byte UTF-8 characters in the buffer cause `drain(..1)` to panic at
462
+ // the char boundary. Marked `should_panic` to capture the current behavior;
463
+ // the follow-up fix commit removes the attribute and asserts correct decode.
464
+ #[test]
465
+ #[should_panic = "is_char_boundary"]
466
+ fn test_try_read_multibyte() {
467
+ let f = io::Cursor::new("\u{c3}");
468
+ let mut r = NBReader::new(f, Options::default());
469
+ // pump bytes from the reader thread into the buffer
470
+ for _ in 0..10 {
471
+ let _ = r.try_read();
472
+ thread::sleep(time::Duration::from_millis(5));
473
+ }
474
475
0 commit comments