From 2503388cfe7ef0e90a384095382f7e6180074cb5 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sat, 6 Jan 2024 20:09:24 +0100 Subject: Initial commit --- tests/piece-table.scm | 19 +++++++++++++++++++ tests/run-tests.sh | 12 ++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/piece-table.scm create mode 100755 tests/run-tests.sh (limited to 'tests') 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 -- cgit v1.2.3