about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--edit.mu29
1 files changed, 29 insertions, 0 deletions
diff --git a/edit.mu b/edit.mu
index d4d8c0da..4b2d6935 100644
--- a/edit.mu
+++ b/edit.mu
@@ -727,6 +727,35 @@ d]
   ]
 ]
 
+scenario editor-wraps-line-on-insert [
+  assume-screen 5:literal/width, 3:literal/height
+  assume-console [
+    type [e]
+  ]
+  run [
+    1:address:array:character <- new [abcd]
+    2:address:editor-data <- new-editor 1:address:array:character, screen:address, 0:literal/top, 0:literal/left, 5:literal/right
+    event-loop screen:address, console:address, 2:address:editor-data
+  ]
+  screen-should-contain [
+    # no wrap yet
+    .eabcd.
+    .     .
+  ]
+  assume-console [
+    type [f]
+  ]
+  run [
+    event-loop screen:address, console:address, 2:address:editor-data
+  ]
+  screen-should-contain [
+    # now wrap
+    .efab↩.
+    .cd   .
+    .     .
+  ]
+]
+
 scenario editor-moves-cursor-after-inserting-characters [
   assume-screen 10:literal/width, 5:literal/height
   assume-console [