diff options
Diffstat (limited to 'tests/piece-table.scm')
-rw-r--r-- | tests/piece-table.scm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/piece-table.scm b/tests/piece-table.scm index 76176a9..62ff11d 100644 --- a/tests/piece-table.scm +++ b/tests/piece-table.scm @@ -7,9 +7,17 @@ (test-begin "index") (define table (make-piece-table "HOLA")) + (test-equal #\H (piece-table-index table 0)) + (test-equal #\O (piece-table-index table 1)) (test-equal #\L (piece-table-index table 2)) + (test-equal #\A (piece-table-index table 3)) (test-end "index") +(test-begin "length") + (define table (make-piece-table "HOLA")) + (test-equal 4 (piece-table-text-length table)) +(test-end "length") + (test-begin "insert") (define table (make-piece-table "HOLA")) (piece-table-insert! table 4 "9" 'normal) @@ -61,3 +69,8 @@ 0 10) (test-end "for-each") + +(test-begin "find") + (define table (make-piece-table "1234567890")) + (test-equal 8 (piece-table-find table #\9 0)) +(test-end "find") |