This is my solution of the challenge posted here. As I stressed in that post, this is just one possible solution, and not even necessarily the best one. I provide it to show how I managed to solve the tests and how I worked in a TDD way.
Speaking of TDD I realised that I hadn't followed it very strictly, as sometimes I wrote more code than needed, usually forecasting future changes. I do not believe in a inflexible and uncompromising application of rules, so I do not consider this a big issue, as long as the result is a working code that is not blatantly overengineered.
Level 1 - End of file
The base class to pass the test leverages the provided
text_buffer.TextBuffer class, that exposes a
load() method, directly composed here to
CalcLexer.load(). As the test is not providing a text the easiest solution is just to return the tested