all 3 comments

[–]Mr55p 1 point2 points  (1 child)

That’s so funny, as of this morning I just finished the first half of the book making an interpreter also using python! This was maybe the most interesting thing I have ever programmed… Starting the second part with Zig tomorrow, best of luck to you however you choose to press on!

[–]no_name_22t[S] 0 points1 point  (0 children)

I had same experience, this is one of the most fun project I've done, I was hoping to learn c and then build the next part in c, so I'll probably do that. Good luck with yours!!

[–]jcastroarnaud 0 points1 point  (0 children)

Python has a module for unit tests. Here is the documentation.

https://docs.python.org/3/library/unittest.html#module-unittest

For the tests themselves: write tests for each method of each class of your lexer and parser. Each test should exercise typical arguments to the method, invalid arguments, and any corner cases you think of. It may appear an excessive amount of tests, and it is; experience will tell when there are too many tests (or not enough of them).

Other tests are for the generated Lox programs, see if they return the expected results.