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.