42-Ikole-Systems / TMK-SH

An awesome POSIX compliant shell.
MIT License
0 stars 0 forks source link

[Test] Make the lexer testable #14

Closed Tishj closed 1 year ago

Tishj commented 1 year ago

What I envision is that we wrap the Lexer in a class that gets a copy of all produced tokens before sending it on. This class also implements TokenProvider so the Parser is none the wiser.

Then we can create a set of expected tokens and assert in a test that the lexer produces these tokens.

Tishj commented 1 year ago

This is overcomplicated, we can just consume from the Lexer normally and just not parse in those tests

mraasvel commented 1 year ago

I guess this was already done but I'll add some more functionality: parameterized tests and some SECTIONS + implementing the << operator in branch 7-lexing-implementation makes it much nicer to test/debug