Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[correctness][missing-coverage][sort] Mixed files and repeated stdin lack a combined regression

クローズ 初心者向け
#638 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
testing

調査の方向性

既存のsortシナリオ、特に TestSortStdinDash、TestSortMultipleFiles、および終端されていないレコードのテストを読み、その後 tests/scenarios/cmd/sort/basic/mixed_files_repeated_stdin.yaml に回帰テストを追加してください。issueのfixtureと再現例を使い、ファイル、繰り返される - オペランド、終端されていないレコードをまとめて対象にします。シナリオが成功し、GNU coreutilsの動作と一致すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Generated by the rshell behavior correctness scanner.

  • Contract: BEH-004
  • Classification: missing-coverage
  • Impact: low
  • Target: sort
  • Scanned commit: 514d1cb8188fda6b1accca5955dfab3b0e8aa34a

Existing tests cover files, stdin, explicit -, and unterminated records separately, but lack a regression combining files with repeated stdin operands and unterminated records. The tested implementation correctly preserves record boundaries and consumes stdin once; no defect was demonstrated.

Contract sources
  • docs/BEHAVIOR_CONTRACTS.md:45-49: Files, stdin, -, multiple operands, and pipes must interact like the selected reference.
  • sort --help: Help says files are concatenated for sorting and - reads standard input.
Implementation references
  • builtins/sort/sort.go:372-388: Reads each operand independently before combining its records.
  • builtins/sort/sort.go:427-446: Each - operand reads the shared stdin stream.

Fixture setup

For each run, create a fresh zz_correctness_scan_ directory and run from it. Set zz_correctness_scan_dir to its absolute path. Create zz_correctness_scan_a.txt containing exactly c\nb with no final newline, and zz_correctness_scan_b.txt containing exactly e\n.

Reproducer

printf 'd\na' | sort -- zz_correctness_scan_a.txt - - zz_correctness_scan_b.txt

Commands used:

  • GOENV_VERSION=1.26.3 timeout 300s go build -o /tmp/zz_correctness_scan_rshell ./cmd/rshell
  • /tmp/zz_correctness_scan_rshell --allowed-commands rshell:sort,rshell:printf --allowed-paths "$zz_correctness_scan_dir" -c "printf 'd\na' | sort -- zz_correctness_scan_a.txt - - zz_correctness_scan_b.txt"
  • LC_ALL=C bash -c "printf 'd\na' | sort -- zz_correctness_scan_a.txt - - zz_correctness_scan_b.txt"
  • GOENV_VERSION=1.26.3 timeout 300s go test ./tests -run '^TestShellScenarios$/^cmd$/^sort$/^(basic|flags|errors|help|pathological|zz_correctness_scan_cases)$' -count=2 -timeout 240s

Verification

  • Reproduction runs: 2
  • Reference: Matched native GNU coreutils 9.4 twice from clean fixtures. The temporary scenario passed both focused scenario runs. Reviewed TestSortStdinDash, TestSortMultipleFiles, and unterminated-record tests; none cover this interaction.
  • Temporary test: tests/scenarios/cmd/sort/zz_correctness_scan_cases/zz_correctness_scan_mixed_sources.yaml; removed after verification. Script, stdout, and stderr used YAML |+ scalars.
  • Suggested regression-test location: tests/scenarios/cmd/sort/basic/mixed_files_repeated_stdin.yaml

Fingerprint: 0cd34bdf1a7770a89bc2569e53707147145f3a4334a30322ad61c107162d3113

主要言語
Go
スター
31
フォーク
3
平均マージ
2日 23時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataDog/rshell のほかの issue

DataDog/rshell の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。