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