Skip to content

[api] Add ability to parse tests to the type_def parser #1776#1777

Merged
michaelvlach merged 5 commits intomainfrom
1776-api-add-ability-to-parse-tests-to-the-type_def-parser
Apr 25, 2026
Merged

[api] Add ability to parse tests to the type_def parser #1776#1777
michaelvlach merged 5 commits intomainfrom
1776-api-add-ability-to-parse-tests-to-the-type_def-parser

Conversation

@michaelvlach
Copy link
Copy Markdown
Collaborator

No description provided.

@michaelvlach michaelvlach requested a review from agnesoft April 25, 2026 08:02
@michaelvlach michaelvlach linked an issue Apr 25, 2026 that may be closed by this pull request
Copilot AI review requested due to automatic review settings April 25, 2026 08:02
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agdb Ready Ready Preview, Comment Apr 25, 2026 8:34am

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 emit Type::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.

Comment thread agdb_derive/src/type_def_parser.rs Outdated
Comment thread agdb_derive/src/type_def_parser/expression_parser.rs Outdated
Comment thread agdb/src/type_def.rs
@michaelvlach michaelvlach merged commit 1068d4b into main Apr 25, 2026
11 checks passed
@michaelvlach michaelvlach deleted the 1776-api-add-ability-to-parse-tests-to-the-type_def-parser branch April 25, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[api] Add ability to parse tests to the type_def parser

3 participants