From d6cad3e8cb771e9f6f15b41f2b013d563d47ff68 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 4 May 2017 13:22:07 +0200 Subject: [PATCH] Adjustments for the test suite Add some tests for valid-c-identifier? --- tests/c-id-valid.scm | 14 ++++++++++++++ tests/runtests.sh | 2 +- tests/scrutiny.expected | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/c-id-valid.scm diff --git a/tests/c-id-valid.scm b/tests/c-id-valid.scm new file mode 100644 index 00000000..65c811fc --- /dev/null +++ b/tests/c-id-valid.scm @@ -0,0 +1,14 @@ +(import (chicken compiler support)) + +(define +invalid-ids+ + '("-foo" + "foo?" + "7foo" + "foo-bar" + "ba!r" + "foo$")) + +(for-each + (lambda (x) + (assert (not (valid-c-identifier? x)) "invalid C identifier" x)) + +invalid-ids+) diff --git a/tests/runtests.sh b/tests/runtests.sh index c3e16cdb..16fcb97f 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -131,7 +131,7 @@ echo "specialized:" $time ./fft2 1000 7 echo "======================================== callback tests ..." -$compile callback-tests.scm +$compile -extend c-id-valid.scm callback-tests.scm ./a.out if ./a.out twice; then diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected index ef9befd1..581aa45b 100644 --- a/tests/scrutiny.expected +++ b/tests/scrutiny.expected @@ -1,5 +1,5 @@ -Note: assignment to imported value binding: car +Note: (scrutiny-tests.scm:31) - assignment to imported value binding `car' Note: in local procedure `c', in local procedure `b', -- 2.12.2