Add unit test for rope with all 4-byte chars

Max Brunsfeld created

Change summary

zed/src/editor/buffer/rope.rs | 8 ++++++++
1 file changed, 8 insertions(+)

Detailed changes

zed/src/editor/buffer/rope.rs 🔗

@@ -403,6 +403,14 @@ mod tests {
     use rand::prelude::*;
     use std::env;
 
+    #[test]
+    fn test_all_4_byte_chars() {
+        let mut rope = Rope::new();
+        let text = "🏀".repeat(256);
+        rope.push(&text);
+        assert_eq!(rope.text(), text);
+    }
+
     #[test]
     fn test_random() {
         let iterations = env::var("ITERATIONS")