MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_multibyte_chars

Function test_multibyte_chars

core/src/reader.rs:186–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184
185 #[test]
186 fn test_multibyte_chars() {
187 let mut input = "Hi 훌리오".as_bytes();
188 let mut reader = CharReader::from(&mut input);
189 assert_eq!(cs('H', 1, 1), reader.next().unwrap().unwrap());
190 assert_eq!(cs('i', 1, 2), reader.next().unwrap().unwrap());
191 assert_eq!(cs(' ', 1, 3), reader.next().unwrap().unwrap());
192 assert_eq!(cs('훌', 1, 4), reader.next().unwrap().unwrap());
193 assert_eq!(cs('리', 1, 5), reader.next().unwrap().unwrap());
194 assert_eq!(cs('오', 1, 6), reader.next().unwrap().unwrap());
195 assert!(reader.next().is_none());
196 }
197
198 #[test]
199 fn test_consecutive_newlines() {

Callers

nothing calls this directly

Calls 1

as_bytesMethod · 0.80

Tested by

no test coverage detected