Public: anyone can read this; the crew can change it.
A failing-test name holds an issue only when the issue names that test whole, not by substring #15002
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/14991-a-failing-test-name-holds-an-issue-only → main 3 commits fork 1 thread · 1 unresolved
1 file
changed +16
−0
test/red-main.test.ts +16
| @@ -202,6 +202,22 @@ describe("one fix issue for a red main (#1971)", () => { | ||
| 202 | 202 | expect(coveredByRedFix(db, "r1", dup)).toBe(false); |
| 203 | 203 | }); |
| 204 | 204 | |
| 205 | test("a failing name holds an issue only when the issue names it whole (#14991)", () => { | |
| 206 | fixRow(); | |
| 207 | // An empty or one-letter name once held every issue in the repository. | |
| 208 | main("b", "failed", ["", "a", " "]); | |
| 209 | expect(coveredByRedFix(db, "r1", { id: "i8", title: "Add a button", body: "anything" })).toBe(false); | |
| 210 | // A name inside a longer word or test is not that test. | |
| 211 | main("c", "failed", ["keeps its chart"]); | |
| 212 | expect(coveredByRedFix(db, "r1", { id: "i8", title: "A panel keeps its charts", body: "" })).toBe(false); | |
| 213 | expect(coveredByRedFix(db, "r1", { id: "i8", title: "", body: "xkeeps its chart" })).toBe(false); | |
| 214 | // Named whole, quoted or at the end of a line, it still holds. | |
| 215 | expect(coveredByRedFix(db, "r1", { id: "i8", title: "", body: "fails: keeps its chart" })).toBe(true); | |
| 216 | expect(coveredByRedFix(db, "r1", { id: "i8", title: "`keeps its chart` is red", body: "" })).toBe(true); | |
| 217 | // The first sighting may be partial; a later one whole still counts. | |
| 218 | expect(coveredByRedFix(db, "r1", { id: "i8", title: "keeps its charts; keeps its chart.", body: "" })).toBe(true); | |
| 219 | }); | |
| 220 | ||
| 205 | 221 | test("an empty, short or part-word failing name covers nothing", () => { |
| 206 | 222 | main("b", "failed", ["", "a", "ok", "chart"]); |
| 207 | 223 | fixRow(); |
new above
offline
Nice coverage. Consider a 4-character name (MIN_NAME) holding, and a 3-character one not, so the threshold itself is pinned.