skx / gobasic

A BASIC interpreter written in golang.
https://blog.steve.fi/tags/basic/
GNU General Public License v2.0
328 stars 27 forks source link

eval/eval_test.go is horrid #70

Closed skx closed 5 years ago

skx commented 5 years ago

We improved our code by breaking our built-in functions to the builtin/ package, and giving that 100% test-coverage.

However our testing for the main core of the interpreter, eval/eval.go, is only at 85% and is done in a very horrid way.

We should remove all tests, and start again. We want to aim for 100% coverage, though I suspect that will also require some overhauling of the code, as things like the bounds-testing (which was necessary to avoid terminate when running fuzz-tesitng) are hard to manage.

(We could add nextToken(), etc to isolate the bounds-checking for example.)