How do people write automated tests? Or does everyone just rely on
manual testing?
--
Susan Davis <s...@sue.net>
The traditional automated test is to write a walkthrough of commands,
pump it into an interpreter, capture the transcript of the output, and
compare that to your last transcript.
(In this form, assertions are easy -- write an Inform function that
prints nothing if the argument is true, but prints "ALERT BOOGA BOOGA"
if the argument is false.)
This is more an end-to-end test than a unit test. But you can
introduce new (debugging) verbs to jump to a particular room and set
up a particular state, and then test commands from there. This lets
you write "walkthroughs" for small pieces of your game. I find that I
need such verbs anyway, in order to *write* the game, so this isn't an
additional complexity.
--Z
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
I'm still thinking about what to put in this space.
> (In this form, assertions are easy -- write an Inform function that
> prints nothing if the argument is true, but prints "ALERT BOOGA BOOGA"
> if the argument is false.)
I now have a very strong urge to download every Zarf game and use txd |
grep "ALERT BOOGA BOOGA".
I use dfrotz, aka "dumb frotz", which is frotz compiled for a very dumb
terminal. It features special input modifiers to test things like timed
input, and the results are fairly easy to analyze.