mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Make utf8 default, implement utf16 in terms of it
This commit is contained in:
parent
00cc778c8c
commit
95209aa3f8
6 changed files with 28 additions and 11 deletions
|
@ -17,14 +17,14 @@ fn test_line_index() {
|
|||
|
||||
let index = LineIndex::new(text);
|
||||
for &(offset, line, col) in &table {
|
||||
assert_eq!(index.line_col(offset.into()), LineColUtf16 { line, col });
|
||||
assert_eq!(index.line_col(offset.into()), LineCol { line, col });
|
||||
}
|
||||
|
||||
let text = "\nhello\nworld";
|
||||
let table = [(0, 0, 0), (1, 1, 0), (2, 1, 1), (6, 1, 5), (7, 2, 0)];
|
||||
let index = LineIndex::new(text);
|
||||
for &(offset, line, col) in &table {
|
||||
assert_eq!(index.line_col(offset.into()), LineColUtf16 { line, col });
|
||||
assert_eq!(index.line_col(offset.into()), LineCol { line, col });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue