summaryrefslogtreecommitdiff
path: root/tests/piece-table.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/piece-table.scm')
-rw-r--r--tests/piece-table.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/piece-table.scm b/tests/piece-table.scm
index 317286c..19bd107 100644
--- a/tests/piece-table.scm
+++ b/tests/piece-table.scm
@@ -30,6 +30,14 @@
(test-equal "6X78" (piece-table-substring table 5 9)))
(test-end "substring")
+(test-begin "insert-newlines")
+ (parameterize ((add-buffer-length 10))
+ (define table (make-piece-table "HOLA\nADIOS"))
+ (piece-table-insert! table 4 "\nHABLAMOS" 'normal)
+ (test-equal "HOLA\nHABLAMOS\nADIOS" (piece-table->string table))
+ (test-equal (piece-table-line table 1) "HABLAMOS"))
+(test-end "insert-newlines")
+
(test-begin "delete")
(define table (make-piece-table "HOLA SOY EKAITZ"))
(piece-table-delete! table 4 1)