munificent / craftinginterpreters

Repository for the book "Crafting Interpreters"
http://www.craftinginterpreters.com/
Other
8.5k stars 1.01k forks source link

Would there be some more flexible way to test third-party implementation ? #1031

Open edimetia3d opened 2 years ago

edimetia3d commented 2 years ago

Hi,

I've implemented both clox and jlox in my GitHub Project after learning this great tutorial.

Like many other people, I've basically hand-typed everything and written the code with my own understanding, so my implementation is quite different from the "standard" implementation, especially in error detecting and error messaging.

To relieve me from testing, I used the unit tests from the upstream repo. However, the dart test tool is very strict in error-message checking, which makes it hard to leverage the test tool.

So I only make my clox implementation fully compatible with the upstream test cases.

For jlox, I created a Test Tool Fork, which only checks exit-code and stdout. Though it is simplified, it does help me to detect many errors.

So I was wondering if there would be some more flexible way to run the test?

Sincerely

nocturn9x commented 2 years ago

I don't think that's doable. To test my own implementation one of my collaborators wrote a testing framework entirely from scratch that can be configured in lox source files to match specific stdout, stderr and stdin (and even provide custom keyboard input)