()
| 259 | |
| 260 | #[test] |
| 261 | fn utf16_cols() { |
| 262 | let src = "aé😀b"; |
| 263 | // 'a'=1, 'é'=1, '😀'=2 utf16 units; bytes: a=1, é=2, 😀=4 |
| 264 | assert_eq!(utf16_len(src), 5); |
| 265 | let starts = line_starts(src); |
| 266 | assert_eq!(col16(src, &starts, 0, 1), 1); // after 'a' |
| 267 | assert_eq!(col16(src, &starts, 0, 3), 2); // after 'é' |
| 268 | assert_eq!(col16(src, &starts, 0, 7), 4); // after '😀' |
| 269 | } |
| 270 | |
| 271 | /// The table gives, at every character of every line, the column that |
| 272 | /// counting the line's characters gives. |
nothing calls this directly
no test coverage detected