summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/piece-table.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/piece-table.scm b/tests/piece-table.scm
index d6c1105..317286c 100644
--- a/tests/piece-table.scm
+++ b/tests/piece-table.scm
@@ -21,6 +21,15 @@
(test-equal "HOLA910" (piece-table->string table))
(test-end "insert")
+(test-begin "substring")
+ (parameterize ((add-buffer-length 10))
+ (define table (make-piece-table "1234567890"))
+ (test-equal "1234567890" (piece-table-substring table 0 10))
+ (test-equal "67890" (piece-table-substring table 5 10))
+ (piece-table-insert! table 6 "X" 'normal)
+ (test-equal "6X78" (piece-table-substring table 5 9)))
+(test-end "substring")
+
(test-begin "delete")
(define table (make-piece-table "HOLA SOY EKAITZ"))
(piece-table-delete! table 4 1)