(index ("make-dummy-user" 0) ("with-dummy-user" 767))
(def (sig (procedure "(make-dummy-user STRINGS)" (id make-dummy-user))) (p "Given a list of strings representing a sequence of user input, this procedure returns a " (tt "DUMMY-USER") " closure, which responds to the following messages:") (pre "(USER 'input)\n(USER 'output)") (p "These calls return, respectively, an input and an output port. Generally you do not need to use them directly; they are used by " (tt "with-dummy-user") " to rebind " (tt "stdin") " and " (tt "stdout") ".") (pre "(USER 'reset)") (p "Resets the dummy user to its initial state, allowing repeated tests with the same data.") (pre "(USER 'dump)") (p "Returns a list of all data received from and sent to the test program, in the form " (tt "'((program: STRING) (user: STRING) ...)") "."))
(def (sig (procedure "(with-dummy-user USER THUNK [RETURN-RESULT])" (id with-dummy-user))) (p "Tests a program with a dummy user; to be precise, it binds " (tt "stdin") " and " (tt "stdout") " to the ports provided by the dummy user. The " (tt "USER") " argument should be a closure such as that produced by " (tt "make-dummy-user") ". " (tt "THUNK") " is a procedure of no arguments that runs the program you wish to test. After running the test program, by default " (tt "with-dummy-user") " calls " (tt "(USER 'dump)") " and returns the result of that call. However, you may provide your own " (tt "RETURN-RESULT") " procedure (with 0 arguments) to cause other data to be returned (e.g. the inputs collected by your program)."))
