summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* Big-ass coding binge presents: a Lisp.Owen Jacobson2017-11-13
| | | | This implements a continuation-passing interpreter, which means we get tail calls ferfree. I stopped short of implementing call/cc, because I don't think we need it, but we can get there if we have to.
* Introduce input ports.Owen Jacobson2017-11-11
| | | | | | | | | | | Ports are the lisp abstraction of files and streams. Actinide ports additionally guarantee a peek operation. This makes ``tokenize`` (now ``read_token``) callable as a lisp function, as it takes a port and reads one token from it. This is a substantial refactoring. As most of the state is now captured by closures, it's no longer practical to test individual states as readily. However, the top-level tokenizer tests exercise the full state space.
* Testing fixes.Owen Jacobson2017-11-11
| | | | | | | | | | | | | | | | | | | | | | * Add a top-level test that roundtrips sequences of tokens. (This found a real bug. Thanks, Hypothesis!) * Remove type conversion from the tokenizer. This simplifies the code, and makes testing considerably easier. * Fix some bugs in string literal parsing (again: Thanks, Hypothesis!) Document the test cases, and the case-by-case strategy, better. This also involved prying apart some tests that cover multiple cases. Stop treating empty strings as if they were EOFs. (Thanks, Hypothesis!) fixup! Stop treating empty strings as if they were EOFs. (Thanks, Hypothesis!) Remove type conversion from the tokenizer. It turns out that this made the tokenizer harder to test, because it was doing too many things. The tokenizer now _only_ divides the input port into tokens, without parsing or converting those tokens. Fix up tests for fuck
* Add tests for the individual tokenizer states.Owen Jacobson2017-11-08