Repository navigation
Use std assert_matches macro in tests - #1955
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
テストコード内の assert!(matches!(...)) を std::assert_matches!(...) に置き換え、失敗時の表示を改善しつつ、テスト記述をより簡潔にする変更です(TOML ツールキット全体の Rust テスト群に対するリファクタリング)。
Changes:
- テスト内の
assert!(matches!(...))をstd::assert_matches!(...)に置換 std::assert_matches!の失敗表示に備えてCargoNavigationFeatureにDebugを導出debug_assert!(matches!(...))は従来どおり維持
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/tombi-extension-pyproject/src/hover.rs | テストの matches! 断言を std::assert_matches! に置換 |
| extensions/tombi-extension-cargo/src/lib.rs | CargoNavigationFeature に Debug を追加し、テスト断言を std::assert_matches! 化 |
| crates/tombi-schema-store/src/store.rs | スキーマストア関連テストの断言を std::assert_matches! に置換 |
| crates/tombi-schema-store/src/schema/value_schema.rs | ValueSchema 推論/解析テストの断言を広範囲に std::assert_matches! へ置換 |
| crates/tombi-schema-store/src/schema/referable_schema.rs | 参照解決テストの matches! 断言を std::assert_matches! に置換(ガード付きも含む) |
| crates/tombi-schema-store/src/schema/document_schema.rs | DocumentSchema の生成テスト断言を std::assert_matches! に置換 |
| crates/tombi-glob/src/walk_dir.rs | エラー種別の断言を std::assert_matches! に置換 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
assert!(matches!(...))calls withstd::assert_matches!(...)DebugforCargoNavigationFeaturesostd::assert_matches!can render assertion failuresdebug_assert!(matches!(...))sites unchangedVerification
cargo fmt --allcargo clippy --workspace --all-targets --locked -- -D warningscargo nextest run --workspace --locked --no-fail-fastcargo test --workspace --doc --locked