From 73e28d46fd5aeb71677eec8e785029b26f6385ef Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Thu, 18 Jan 2024 22:25:34 +0100 Subject: par: piece-table: add line accessor function --- tests/piece-table.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/piece-table.scm') 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) -- cgit v1.2.3