jnavb
1
This is an example of code and the Ast from my lezer parser:
code: foo.
Ast: ObjectCreationExpression(Identifier,".",⚠)
Is there a way to test this case with fileTests from @lezer/generator/dist/test ?
I understand the test runner fails whenever it find an error node SyntaxError: No parse at X
Maybe testTree supports this (haven’t test it) but it would be nice to use the same approach to test happy/unhappy paths
marijn
2
If there’s a ⚠ character in your expected tree, it won’t.
jnavb
3
Will check again if I missed anything, thanks
Toly
4
@jnavb Hi, already solved or not?
jnavb
5
@Toly iirc it was a typo on my end, regards.
Toly
6
@jnavb BTW, which function do you use to write the unit test? fileTests or testTree?