chickadee » dummy-user » with-dummy-user

with-dummy-user USER THUNK #!optional RETURN-RESULTprocedure

Tests a program with a dummy user; to be precise, it binds stdin and stdout to the ports provided by the dummy user. The USER argument should be a closure such as that produced by make-dummy-user. THUNK is a procedure of no arguments that runs the program you wish to test. After running the test program, by default with-dummy-user calls (USER 'dump) and returns the result of that call. However, you may provide your own RETURN-RESULT procedure (with 0 arguments) to cause other data to be returned (e.g. the inputs collected by your program).