I am super impressed that tree-sitter has built-in testing facilities for both parse trees: https://github.com/Wilfred/tree-sitter-elisp/blob/main/test/corpus/function_definition.txt and syntax highlighting: https://github.com/Wilfred/tree-sitter-elisp/blob/main/test/highlight/functions.el Syntax parsing is all about the tricky cases and this is a huge help.