From 3dcfb739029b53b224e4fc2a42458c88902b8290 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Mon, 8 Jan 2024 15:49:14 +0100 Subject: par: piece-table: rewrite insert to make it work --- tests/piece-table.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/piece-table.scm b/tests/piece-table.scm index d1fa32a..04a62bc 100644 --- a/tests/piece-table.scm +++ b/tests/piece-table.scm @@ -12,9 +12,13 @@ (test-begin "insert") (define table (make-piece-table "HOLA")) - (piece-table-insert! table 2 "90") - (test-equal #\9 (piece-table-index table 2)) - (test-equal #\0 (piece-table-index table 3)) + (piece-table-insert! table 4 "9" 'normal) + (piece-table-insert! table 5 "0" 'normal) + (test-equal #\9 (piece-table-index table 4)) + (test-equal #\0 (piece-table-index table 5)) + (test-equal "HOLA90" (piece-table->string table)) + (piece-table-insert! table 5 "1" 'normal) + (test-equal "HOLA910" (piece-table->string table)) (test-end "insert") (test-begin "delete") -- cgit v1.2.3