Open
Description
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):
- Add a
test
directory for the integration tests - Write a module
toy_language
inside thetest
directory- Implement all the necessary things for rowan (see examples and Make A Language Blog )
- Instead of writing a complete lexer / parser, simply write a method
build_toy_tree
which uses theGreenNodeBuilder
and constructs a meaningful tree by hand (which provides enough depth / siblings / ... to use for testing)
- Confirm the
toy_language
tree and underlaying source string looks like expected by writing two tests for this - Start implementing tests for the tree traversal / accessing tree nodes API
Metadata
Metadata
Assignees
Labels
No labels