aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLaurențiu Nicola <[email protected]>2020-05-05 17:22:01 +0100
committerLaurențiu Nicola <[email protected]>2020-05-05 17:39:45 +0100
commit7ec1b63f813e45f26668c2d6d803ec72c3c75738 (patch)
tree538a8cba19985bc7bf1c2a50f6147cde63fe4b6e /crates
parent7c1d5f286a971484fc1f1d367e762853471873e4 (diff)
Add tests for #4306
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/main_loop.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index b163ea848..b77f0c5a9 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -1083,5 +1083,17 @@ mod tests {
1083 assert_eq!(text, "the quick foxes\nDREAM\nthey have quiet dreams\nDON'T THEY?\n"); 1083 assert_eq!(text, "the quick foxes\nDREAM\nthey have quiet dreams\nDON'T THEY?\n");
1084 run(&mut text, c![0, 10; 1, 5 => "", 2, 0; 2, 12 => ""]); 1084 run(&mut text, c![0, 10; 1, 5 => "", 2, 0; 2, 12 => ""]);
1085 assert_eq!(text, "the quick \nthey have quiet dreams\n"); 1085 assert_eq!(text, "the quick \nthey have quiet dreams\n");
1086
1087 text = String::from("❤️");
1088 run(&mut text, c![0, 0; 0, 0 => "a"]);
1089 assert_eq!(text, "a❤️");
1090
1091 text = String::from("a\nb");
1092 run(&mut text, c![0, 1; 1, 0 => "\nțc", 0, 1; 1, 1 => "d"]);
1093 assert_eq!(text, "adcb");
1094
1095 text = String::from("a\nb");
1096 run(&mut text, c![0, 1; 1, 0 => "ț\nc", 0, 2; 0, 2 => "c"]);
1097 assert_eq!(text, "ațc\ncb");
1086 } 1098 }
1087} 1099}