✨ feat(mq-test): add standalone test runner binary#1574
Merged
Conversation
Add `mq-test` as a new standalone crate with its own binary. Test functions are auto-discovered from `.mq` files via the CST (`mq_lang::parse_recovery`) — no manual `run_tests([...])` list needed. Discovery rules: - `def test_*` functions are included automatically - `def` preceded by `# @test` annotation is included regardless of name Function name is extracted from `children[0]` of the Def CST node, consistent with how mq-formatter resolves identifiers. Comment annotations are read from `node.leading_trivia`. Usage: mq-test file.mq # run tests in specific file mq-test # glob **/*.mq in current directory
Co-authored-by: harehare <533078+harehare@users.noreply.github.com>
…132075 Format code using cargo fmt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
mq-testas a new standalone crate with its own binary. Test functions are auto-discovered from.mqfiles via the CST (mq_lang::parse_recovery) — no manualrun_tests([...])list needed.Discovery rules:
def test_*functions are included automaticallydefpreceded by# @testannotation is included regardless of nameFunction name is extracted from
children[0]of the Def CST node, consistent with how mq-formatter resolves identifiers. Comment annotations are read fromnode.leading_trivia.Usage: