aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/line_index/tests.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-02-12 19:09:53 +0000
committerAleksey Kladov <[email protected]>2021-02-16 16:17:32 +0000
commit95209aa3f8e4b149da6adb374611ece76c2b82ca (patch)
tree37e5b2aa72b597586f27c5200d25abb349d6c11f /crates/ide_db/src/line_index/tests.rs
parent00cc778c8c62e8f68531c1cadcce8b05b7287d84 (diff)
Make utf8 default, implement utf16 in terms of it
Diffstat (limited to 'crates/ide_db/src/line_index/tests.rs')
-rw-r--r--crates/ide_db/src/line_index/tests.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_db/src/line_index/tests.rs b/crates/ide_db/src/line_index/tests.rs
index af51d7348..09f3bca62 100644
--- a/crates/ide_db/src/line_index/tests.rs
+++ b/crates/ide_db/src/line_index/tests.rs
@@ -17,14 +17,14 @@ fn test_line_index() {
17 17
18 let index = LineIndex::new(text); 18 let index = LineIndex::new(text);
19 for &(offset, line, col) in &table { 19 for &(offset, line, col) in &table {
20 assert_eq!(index.line_col(offset.into()), LineColUtf16 { line, col }); 20 assert_eq!(index.line_col(offset.into()), LineCol { line, col });
21 } 21 }
22 22
23 let text = "\nhello\nworld"; 23 let text = "\nhello\nworld";
24 let table = [(0, 0, 0), (1, 1, 0), (2, 1, 1), (6, 1, 5), (7, 2, 0)]; 24 let table = [(0, 0, 0), (1, 1, 0), (2, 1, 1), (6, 1, 5), (7, 2, 0)];
25 let index = LineIndex::new(text); 25 let index = LineIndex::new(text);
26 for &(offset, line, col) in &table { 26 for &(offset, line, col) in &table {
27 assert_eq!(index.line_col(offset.into()), LineColUtf16 { line, col }); 27 assert_eq!(index.line_col(offset.into()), LineCol { line, col });
28 } 28 }
29} 29}
30 30