There should be a simple toy language and toy syntax tree to test all / most of the tree api methods (traversal and accessing specific nodes / tokens).
This issue tries to improve the testing situation in rowan, so things like #139 (off-by-one-error) can be caught at an early stage and projects depending on this library don't have to find these bugs the hard way. This should also allow for easier refactoring / internal changes with the confidence, that the public api still works as expected. Also future PRs which provide bug fixes for the public API can also provide a test for it to help increase the coverage.
steps to do this (out of my head / only a suggestion for the implementation):
There should be a simple toy language and toy syntax tree to test all / most of the tree api methods (traversal and accessing specific nodes / tokens).
This issue tries to improve the testing situation in rowan, so things like #139 (off-by-one-error) can be caught at an early stage and projects depending on this library don't have to find these bugs the hard way. This should also allow for easier refactoring / internal changes with the confidence, that the public api still works as expected. Also future PRs which provide bug fixes for the public API can also provide a test for it to help increase the coverage.
steps to do this (out of my head / only a suggestion for the implementation):
testdirectory for the integration teststoy_languageinside thetestdirectorybuild_toy_treewhich uses theGreenNodeBuilderand constructs a meaningful tree by hand (which provides enough depth / siblings / ... to use for testing)toy_languagetree and underlaying source string looks like expected by writing two tests for this