Here is a testing framework I wrote (for CS 360 class). You can use it to test if your Scheme functions give the correct output. Here’s an example of how you use it:
(load "test-framework.scm")
(load "foo.scm")
(test-with-cases foo
(list
'(( 1 1 ) 2)
'(( 10 5 ) 15)
'(( 12 2 ) 14)
))
test-with-cases
takes the function to test and then a list of test cases. A test case is a list with two parts: a list of arguments to call the function with and the desired output. It prints either a message for each failing test case or a message saying that all tests for that function passed.
The code is here, in this Gist. The test framework is in “test-framework.scm”, while the suggested structure for your files is in “foo.scm”, “foo-test.scm”, “bar.scm”, and “bar-test.scm”. “example-test-run.txt” shows how to run your tests.