diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/piece-table.scm | 19 | ||||
-rwxr-xr-x | tests/run-tests.sh | 12 |
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/piece-table.scm b/tests/piece-table.scm new file mode 100644 index 0000000..ecf57bc --- /dev/null +++ b/tests/piece-table.scm @@ -0,0 +1,19 @@ +(import (srfi 64) + (par piece-table)) + +;; https://srfi.schemers.org/srfi-64/srfi-64.html + + +(test-begin "index") + (define table (make-piece-table "HOLA" "" (list))) + (test-equal #\L (piece-table-index table 2)) +(test-end "index") + +(test-begin "insert") + (define table (make-piece-table "HOLA" "" (list))) + (piece-table-insert! table 2 #\9) + (test-equal #\9 (piece-table-index table 2)) +(test-end "insert") + +(test-begin "delete") +(test-end "delete") diff --git a/tests/run-tests.sh b/tests/run-tests.sh new file mode 100755 index 0000000..e9a543d --- /dev/null +++ b/tests/run-tests.sh @@ -0,0 +1,12 @@ +HERE=`dirname $0` +TESTS=$@ + +pushd "$HERE" +if [ -z "$TESTS" ]; then + TESTS=*.scm +fi + +for i in $TESTS; do + guile -L .. --r7rs "$i" +done +popd |