DeMille / encrusted

A z-machine (interpreter) for text adventure games like Zork
https://sterlingdemille.com/encrusted
MIT License
127 stars 20 forks source link

Use RegTest to run tests (closes #19) #20

Closed curiousdannii closed 5 years ago

curiousdannii commented 5 years ago

Starts using the RegTest framework for running tests (closes #19). I've left the czech files where they are, but you may want to move them to a flatter structure? Up to you.

I also added three .z3 games, which can all be freely distributed, to have tests for more than unit tests. I'd only done a test script for Curses already, so that's the only one I added so far. But this raised an issue: your auto-bolding of object names makes the test not work. Now arguably that's something an interpreter shouldn't be doing, however it made me realise the RegTest framework also wouldn't handle author controlled formatting either. May have to see if either it can ignore the ANSI formatting controls, or if it should invoke the interpreters not in TTY mode.

curiousdannii commented 5 years ago

So I determined that RegTest is working correctly, but Encrusted's code for determining whether it was being run in a terminal was inadequate - Python sets a width on its pipes even though it's not a full TTY. I added atty to test properly whether it's being run in a terminal.

DeMille commented 5 years ago

This is awesome! RegTest is like what I was trying to do with my cheap script, thanks for adding this. It's way more robust.

You're right about the auto-bolding; I'm definitely taking some liberties there. Mostly because I'm horrible at IF games and I realized I could force the interpreter to spell it out for me, ha. I should put that functionality behind a flag or something though.