iterators3 tests dont check if errors are returned correctly
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust
- 領域
- testing-qa
調査の方向性
exercises/18_iterators/iterators3.rs と既存のテストから始め、そこにあるアサーションを issue で説明されているフィルタリングの解決策と比較します。Err バリアントを破棄する実装が失敗するように、演習またはテスト入力を更新し、意図した Result の動作がカバーされていることを確認します。
索引モデルが issue の本文から書いたものです。
説明
I'm currently doing rustlings and struggled with iterators3 and searched a solution, which i thought i found here.
It implements one of the functions to edit like this:
fn result_with_list() -> Result<Vec<i64>, DivisionError> {
let numbers = vec![27, 297, 38502, 81];
let division_results = numbers.into_iter().map(|n| divide(n, 27));
division_results.filter(|x| x.is_ok()).collect()
}
which compiles and passes the implemented test but this didn't make any sense to me, as this can never return a correct Err variant, at "best" this would return and empty Vec<i64>, if every division returns an Err variant, which is, as far as i understand, not the intended solution.
To remedy this, I would suggest adding test cases to cover this wrong solution, but since the functions that get tested here don't take any parameters, but instead have hard-coded values inside them, this would require changing their signature and passing in the vector of numbers to be divided.
I'm new to rust, so please let me know if this isn't a real issue.
If this is indeed a real issue, I'm happy to suggest an updated version of this exercise.
- 主要言語
- Rust
- スター
- 64.8k
- フォーク
- 11.3k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/rustlings のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
A-exercises C-enhancement P-low
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
Proposal: German (Deutsch) translation for Community Exercises再び着手できるかも @mo8it が 82 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
rust-lang/rustlings#2445 · コメント 4 件 · リアクション 2 件 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
rust-lang/rustlings の issue をすべて見る
似ている issue
-
fix: production-image scan fails on base-image CVEs (libzstd, libssl)対応中かも @Kravalg が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
VilnaCRM-Org/notification-service#41 ·
メンテナーはふだん 4 日以内に返信
-
Thai project names become 'project', 'project-2'… (slug keeps ASCII only)対応中かも @mastel2 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
storytold/craft-anything#2538 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
compiler-explorer/compiler-explorer#9738 ·
メンテナーはふだん 2 日以内に返信
-
area: runtime enhancement good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
hffgzktbcc-blip/ounce-core#663 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
zellij-org/zellij#6026 ·
メンテナーはふだん 1 日以内に返信