Skip to content

Use std assert_matches macro in tests - #1955

Merged
ya7010 merged 1 commit into
mainfrom
ya7010/std-assert-matches
Jun 21, 2026
Merged

ya7010 merged 1 commit into
mainfrom
ya7010/std-assert-matches

Conversation

@ya7010

@ya7010 ya7010 commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace test assert!(matches!(...)) calls with std::assert_matches!(...)
  • derive Debug for CargoNavigationFeature so std::assert_matches! can render assertion failures
  • leave debug_assert!(matches!(...)) sites unchanged

Verification

  • cargo fmt --all
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo nextest run --workspace --locked --no-fail-fast
  • cargo test --workspace --doc --locked

@ya7010 ya7010 added ignore-for-release Ignore for Release Note rust Pull requests that update rust code labels Jun 21, 2026
Copilot AI review requested due to automatic review settings June 21, 2026 07:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@ya7010
ya7010 merged commit 14fdcfe into main Jun 21, 2026
24 checks passed
@ya7010
ya7010 deleted the ya7010/std-assert-matches branch June 21, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release Ignore for Release Note rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants