MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / utf16_cols

Function utf16_cols

codegraph-kernel/src/textutil.rs:164–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162
163 #[test]
164 fn utf16_cols() {
165 let src = "aé😀b";
166 // 'a'=1, 'é'=1, '😀'=2 utf16 units; bytes: a=1, é=2, 😀=4
167 assert_eq!(utf16_len(src), 5);
168 let starts = line_starts(src);
169 assert_eq!(col16(src, &starts, 0, 1), 1); // after 'a'
170 assert_eq!(col16(src, &starts, 0, 3), 2); // after 'é'
171 assert_eq!(col16(src, &starts, 0, 7), 4); // after '😀'
172 }
173
174 #[test]
175 fn init_sig_short_and_long() {

Callers

nothing calls this directly

Calls 1

line_startsFunction · 0.70

Tested by

no test coverage detected