Skip to content

✨ feat(mq-lang): add assert_type, assert_field, assert_matches to test module - #2133

Merged
harehare merged 1 commit into
mainfrom
feat/assert-node-api
Aug 1, 2026
Merged

✨ feat(mq-lang): add assert_type, assert_field, assert_matches to test module#2133
harehare merged 1 commit into
mainfrom
feat/assert-node-api

Conversation

@harehare

@harehare harehare commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a node/domain assertion API to the test module: assert_type checks a markdown node kind (or runtime type for scalars), assert_field checks a required dict key, and assert_matches checks a value's string form against a regex. All three return the value on success or an error dict with a source range and message on failure, so callers can point at the exact node that failed a constraint.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation
  • ⚡ Performance
  • ✅ Test
  • 📦 Build / dependencies
  • 👷 CI

Checklist

  • I ran cargo fmt and cargo clippy and addressed any warnings
  • I ran just test-all and all tests pass
  • I added or updated tests covering this change
  • I updated relevant documentation (/docs, crate README.md) if needed
  • I added a changelog entry if this is a user-facing change

Additional Context

…t module

Adds a node/domain assertion API to the test module: assert_type checks a
markdown node kind (or runtime type for scalars), assert_field checks a
required dict key, and assert_matches checks a value's string form against
a regex. All three return the value on success or an error dict with a
source range and message on failure, so callers can point at the exact
node that failed a constraint.
@codspeed-hq

codspeed-hq Bot commented Aug 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing feat/assert-node-api (7b77fae) with main (7652a84)

Open in CodSpeed

@harehare
harehare merged commit 9a795d1 into main Aug 1, 2026
11 checks passed
@harehare
harehare deleted the feat/assert-node-api branch August 1, 2026 13: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.

1 participant