Exposing `BinaryExpr` members
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- cpp
- 領域
- testing-qa
調査の方向性
src/catch2/internal/catch_decomposer.hpp の BinaryExpr から始めて、Decomposer がオペランドと演算子をどのように保持しているかを確認します。左辺、右辺、演算子を要求された const accessor を通じて公開し、プロジェクトでカバレッジが必要な場合は、関連する既存のテストを更新するか追加すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Currently, Catch only provides string versions of the left- and right-hand side when tests fail. For instance, something like:
CHECK( v1 == v2 )
with expansion:
{ 1, 2, 3 } == { 1, 3, 4 }
This is a good start, but it isn't enough when comparing more complicated structures, where you want some more information. pytest, for instance, will print a full diff. So you'll get something more like:
CHECK( v1 == v2 )
with expansion:
{ 1, 2, 3 } == { 1, 3, 4 }
At index 1 diff: 2 != 3
Full diff:
[
1,
- 2,
3,
+ 4,
]
Which is a lot more useful. There doesn't seem to be any way to provide more specific messages for errors. The Matcher API has no relevant hook for this.
We looked into trying to do this on our own — BinaryExpr<T, U> has the T and the U, but they are both private members with no accessors. So in order to attempt to implement something like the above, we would have to either (a) reimplement/copy the Decomposer logic, which is involved or (b) do shenanigans relying on just knowing where in BinaryExpr the T and the U are and just yolo-reinterpret-casting at specific memory locations. Neither of which I actually want to do.
It would be easier to simply add to BinaryExpr these getters:
constexpr auto lhs() const -> auto const& { return m_lhs; }
constexpr auto rhs() const -> auto const& { return m_rhs; }
constexpr auto op() const -> StringRef { return m_op; }
(Returning auto const& instead of LhsT const& since LhsT could be some T& and I'd want to unconditionally return T const& there, and auto const& is just an easier way to achieve that than something like std::remove_reference_t<LhsT> const&).
Would you be open to that addition?
- 主要言語
- C++
- スター
- 21.6k
- フォーク
- 3.4k
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
catchorg/Catch2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 2 日以内に返信
-
catch_discover_tests passes all EXTRA_ARGS as one argument対応中かも @CyberKun が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
catchorg/Catch2#3239 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Not seeing some error messages from fakeit in jetbrains rider対応中かも @Amanpal9 が 21 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
catchorg/Catch2#3228 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
catch_discover_tests fails for Emscripten/WASM tests since v3.16.0対応中かも @nafiurahman00 が 8 日前に担当しました。 オープンExtras
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
catchorg/Catch2#3241 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
catchorg/Catch2 の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cp-algorithms/cp-algorithms#1774 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
telefonicaid/fiware-orion#4836 ·
メンテナーはふだん 1 日以内に返信
-
nixd exits at startup when its parent process belongs to another user対応中かも @conao3 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nix-community/nixd#930 ·
メンテナーはふだん 2 日以内に返信
-
refactor topic-ui topic-weather
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Command-Install Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
microsoft/winget-cli#6718 ·
メンテナーはふだん 2 日以内に返信