[api] Add ability to parse tests to the type_def parser #1776#1777
Merged
michaelvlach merged 5 commits intomainfrom Apr 25, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new proc-macro attribute to generate type definitions for test functions, enabling the type_def parser to represent tests distinctly from normal functions.
Changes:
- Introduces
#[agdb::test_def]and plumbing to emitType::Test(Function { ... })for annotated test functions. - Extends macro/expression parsing to treat
matches!as a call-like macro. - Adds/updates unit tests (including a
#[tokio::test]async test) and dev-dependency support.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| agdb_derive/src/type_def_parser/function_parser.rs | Refactors function parsing into an internal helper and adds a test-function wrapper. |
| agdb_derive/src/type_def_parser/expression_parser.rs | Adds matches! to the set of call-like macros. |
| agdb_derive/src/type_def_parser.rs | Adds test_def_impl proc-macro implementation. |
| agdb_derive/src/lib.rs | Exposes the new #[proc_macro_attribute] test_def. |
| agdb/src/type_def/function_def.rs | Adds tests validating Type::Test output (including tokio async test). |
| agdb/src/type_def/expression_def.rs | Adds coverage ensuring assert/matches macros are parsed as calls. |
| agdb/src/type_def.rs | Adds Type::Test(Function) and updates helpers/tests accordingly. |
| agdb/src/lib.rs | Re-exports test_def under the api feature. |
| agdb/Cargo.toml | Adds tokio as a dev-dependency to support async test coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
agnesoft
approved these changes
Apr 25, 2026
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.
No description provided.