From 7ec1b63f813e45f26668c2d6d803ec72c3c75738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 5 May 2020 19:22:01 +0300 Subject: Add tests for #4306 --- crates/rust-analyzer/src/main_loop.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 { assert_eq!(text, "the quick foxes\nDREAM\nthey have quiet dreams\nDON'T THEY?\n"); run(&mut text, c![0, 10; 1, 5 => "", 2, 0; 2, 12 => ""]); assert_eq!(text, "the quick \nthey have quiet dreams\n"); + + text = String::from("❤️"); + run(&mut text, c![0, 0; 0, 0 => "a"]); + assert_eq!(text, "a❤️"); + + text = String::from("a\nb"); + run(&mut text, c![0, 1; 1, 0 => "\nțc", 0, 1; 1, 1 => "d"]); + assert_eq!(text, "adcb"); + + text = String::from("a\nb"); + run(&mut text, c![0, 1; 1, 0 => "ț\nc", 0, 2; 0, 2 => "c"]); + assert_eq!(text, "ațc\ncb"); } } -- cgit v1.2.3