jackfirth / jackfirth/resyntax
Asserting on syntax paths in analysis tests
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 70
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Currently, analysis-test test cases can only make assertions about analyzer property values being basic literal datums like strings, numbers, and symbols. But it's very useful for analyzers to add cross-references between different syntax objects using syntax paths, and analysis tests should be able to make assertions about that. One way for this to work would be to support the string syntax path format mentioned in #653 as a literal datum in #lang resyntax/test.
Another might be to do something like the @within ... @inspect ... options, like an @assertReferences <codeblock> @within <codeblock> alternative to @assert <value>, which would assert that the tested property value is a syntax path referring to a part of the test program identified by <codeblock> @within <codeblock>. Like @within <codeblock> @inspect <codeblock>, the @within <codeblock> part should be optional and its purpose is to disambiguate when the expected code block occurs multiple times within the test program.
The latter approach seems better from a user perspective, because it's difficult to tell what a syntax path corresponds to in a given textual program. Syntax paths are much more useful when looking at raw S-expressions than arbitrary surface syntax code strings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the analysis-test cases and the #lang resyntax/test assertion forms described in the issue. Compare the existing @assert behavior with the @within ... @inspect ... options and review issue #653 for the syntax path format. Done means analysis tests can assert syntax-path references in a way that handles repeated code blocks and is useful to test authors.
Written by the indexing model from the issue text.
Assessment
- Domain
- testing-qa, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100