3 ms·
I wrote a one-off test script to do a REPL session as tests. You just make a file with the commands you want, run it, and the system replaces the input-only fil
by gre 6y ago
I wrote a one-off test script to do a REPL session as tests. You just make a file with the commands you want, run it, and the system replaces the input-only file with the inputs+outputs. Subsequent runs replace the output.
Then you can check that file into version control, and whenever you run it you get a diff of the broken tests. If they're not actually broken, just check in the new file and you've updated your tests. It works really well for this project, a search engine.
https://github.com/pipedown/noise/blob/master/update-test-repl.sh https://github.com/pipedown/noise/blob/master/update-test-re...
https://github.com/pipedown/noise/blob/master/repl-tests/collation.noise https://github.com/pipedown/noise/blob/master/repl-tests/col...