The generator is a little too greedy with Iterable of Path and make tests fails
まだ誰も着手していません。
評価
調査の方向性
まず、リンク先の assertj-foo.zip サンプルを展開し、FooTest を実行して失敗する hasPath アサーションを再現します。java.lang.Iterable を実装する型をジェネレーターがどのように処理するかを、java.util.Collection との違いを含めて追跡します。Path に類似した Iterable 型が等価性セマンティクスを使用し、Collection 型がコレクション述語を維持したまま、テストが成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
With 2.1.0 version, the generator is too greedy when encountering a class implementing an java.lang.Iterable. It should ignore it unless the type extends java.util.Collection (where that make sense) or explicitly a java.lang.Iterable (where it is harder to tell it makes sense).
Sample classes: assertj-foo.zip
The test (FooTest) will fail because the usage of hasPath is NOT the same than using an iterable: we want to test an equals rather than a collection predicate. Here the exception: java.lang.AssertionError: Expecting: <foobar\a>to contain: <[foobar\a]>but could not find: <[foobar\a]>
A working alternative is to convert the Path into a List extracting the Iterable content, but that is wrong by all means:
- first, the default semantic is not good (the default = search for subsequence in any order)
- second, as an user, I want to test the path using
equals(and that is what the generator produce if I have a class not implementingjava.lang.Iterable):
final List<Path> paths = new ArrayList<>();
test.forEach(paths::add); // says ["foobar", "A"]
assertThat(foo).hasPath(paths);
- 主要言語
- Java
- スター
- 72
- フォーク
- 47
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
assertj/assertj-generator のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
assertj/assertj-generator#278 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
assertj/assertj-generator#220 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
assertj/assertj-generator#219 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
assertj/assertj-generator#204 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
assertj/assertj-generator#197 · コメント 7 件 ·
assertj/assertj-generator の issue をすべて見る
似ている issue
-
area/plugin
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
kestra-io/plugin-kestra#190 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/rocketmq-dashboard#5064 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
wso2/dpdp-accelerator#287 ·