GoodPrompts
主導覽
提示詞庫

Review a diff for regressions

Identify observable behavior changes and suggest a focused test.

分類
程式設計
作者
GoodPrompts
原始語言
English
執行證據
有執行範例

填寫並複製

變數

最終提示詞

Review {{diff}} against {{expected behavior}}. Report only findings supported by the change. For each finding include the changed expression, the input that triggers a regression, the expected and actual behavior, and a focused test. Leave style suggestions out unless they affect behavior.

填寫全部變數後,即可複製完整提示詞。

查看原始範本

提示詞原文

Review {{diff}} against {{expected behavior}}. Report only findings supported by the change. For each finding include the changed expression, the input that triggers a regression, the expected and actual behavior, and a focused test. Leave style suggestions out unless they affect behavior.

執行範例

Codex · · 單次執行,未記錄確切模型版本。

輸入

Expected: a free plan has 0 remaining credits and should display 0.
Diff: - const remaining = plan.remaining ?? fallback;
+ const remaining = plan.remaining || fallback;
Fallback = 10.

輸出

Regression: `plan.remaining || fallback` treats 0 as missing. With remaining = 0 and fallback = 10, the expected display is 0 and the actual display is 10. Add a regression test with these values and assert the result is 0.

Identifies the changed operator and a concrete zero input, with expected and actual behavior.