Skip to content

Commit afffd12

Browse files
donislawdevclaude
andcommitted
gui: name every outcome the manifest can record, in the manifest's own words
From an outside review of #125, and the remark was true and smaller than the defect. Measured: internal/recipe declares FOUR outcomes - accept, reject, sanitize, unspecified - and the third step of "How to use it" named two of them, invented a third word for one of those ("turn it away" for reject) and left sanitize out altogether. The remark was about the word. The defect was the list. It is pitfall 15 in its plainest form: a list copied by hand out of a closed set, with nothing comparing it to the source. A fifth outcome would have left that sentence untrue and nothing in the tree would have said so. Fixed twice over. The sentence names all four with the spelling the manifest uses - sanitize, not sanitise, because that is the value rather than a preference in the surrounding prose. And the new guard reads recipe.Outcomes() from the REGISTRY and asks that every outcome it declares is named on the screen, so a fifth is caught by being declared. Mutation: sanitize dropped from the sentence - caught. guitext_test.go leaves notYetJustified, because the verdict written for the second remark cites it. That list may only shrink. The other two remarks are recorded as FALSE in docs/REGRESSION.md, each with the measurement that settles it rather than with an opinion. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 5fc2858 commit afffd12

6 files changed

Lines changed: 46 additions & 5 deletions

File tree

‎internal/guard/aboutuse_test.go‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
_ "github.com/donislawdev/TestingFilesGenerator/internal/format/all"
88
"github.com/donislawdev/TestingFilesGenerator/internal/gui/text"
9+
"github.com/donislawdev/TestingFilesGenerator/internal/recipe"
910
)
1011

1112
// The screen that says what this program is also says what to do with it.
@@ -63,3 +64,35 @@ func TestTheAboutScreenSaysHowToUseTheProgram(t *testing.T) {
6364
t.Errorf("the About screen no longer says what this program is:\n%s", said)
6465
}
6566
}
67+
68+
// TestTheStepsNameEveryOutcomeTheManifestCanRecord.
69+
//
70+
// The third step tells somebody what they will find in the manifest, which
71+
// makes it a list copied out of a closed set - and a list copied by hand that
72+
// nothing compares with its source goes stale on green. The set is
73+
// recipe.Outcomes(), four values today, and the first version of that step
74+
// named two of them, invented a third word for one ("turn it away" for
75+
// reject) and left sanitize out altogether. Nothing in the tree would have
76+
// said so.
77+
//
78+
// Read from the REGISTRY rather than from a list here, so a fifth outcome is
79+
// caught by being declared. That is the whole reason this is a guard and not
80+
// a proofread.
81+
func TestTheStepsNameEveryOutcomeTheManifestCanRecord(t *testing.T) {
82+
content, _ := laidOutWindow(t)
83+
about := tabContent(t, content, text.TabAbout())
84+
said := shownText(about)
85+
86+
outcomes := recipe.Outcomes()
87+
if len(outcomes) < 2 {
88+
t.Fatalf("the recipe package declares %d outcome(s), which is too few for this to compare anything", len(outcomes))
89+
}
90+
for _, outcome := range outcomes {
91+
if !strings.Contains(said, outcome) {
92+
t.Errorf("the manifest can record outcome %q and the About screen never uses that word, "+
93+
"so somebody reading the steps meets it for the first time in the JSON.\nThe screen says:\n%s",
94+
outcome, said)
95+
}
96+
}
97+
t.Logf("%d outcome(s) named on the screen: %v", len(outcomes), outcomes)
98+
}

‎internal/guard/regressiontable_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ var notYetJustified = []string{
5555
"exeproperties_test.go",
5656
"foldedsections_test.go",
5757

58-
"guitext_test.go",
5958
"keyboard_test.go",
6059
"livecheck_test.go",
6160
"openlist_test.go",
4.44 KB
Loading

‎internal/guard/testdata/screens/about.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
<container size="777x29">
9191
<widget size="777x29" type="*widget.Label">
9292
<widget size="777x29" type="*widget.RichText">
93-
<text color="placeholder" size="753x14" textSize="12">Point your test at the manifest. For every file it says what the system under test should do with it - accept it, turn it away, or leave the</text>
94-
<text color="placeholder" pos="0,14" size="220x14" textSize="12">answer to the application's own policy.</text>
93+
<text color="placeholder" size="751x14" textSize="12">Point your test at the manifest. For every file it says what the system under test should do with it - accept it, reject it or sanitize it - or</text>
94+
<text color="placeholder" pos="0,14" size="570x14" textSize="12">records the outcome as unspecified, where the right answer belongs to the application's own policy.</text>
9595
</widget>
9696
</widget>
9797
</container>

‎internal/gui/text/locale/en.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
},
299299
"HowToUseRead": {
300300
"description": "Shown in the window.",
301-
"other": "Point your test at the manifest. For every file it says what the system under test should do with it - accept it, turn it away, or leave the answer to the application's own policy."
301+
"other": "Point your test at the manifest. For every file it says what the system under test should do with it - accept it, reject it or sanitize it - or records the outcome as unspecified, where the right answer belongs to the application's own policy."
302302
},
303303
"ManifestNamed": {
304304
"description": "Shown in the window. Carries one value, {{.Name}}, which has to stay spelled exactly that way.",

‎internal/gui/text/screens.go‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,23 @@ func SectionHowToUse() string { return say("SectionHowToUse", "How to use it") }
6161
// application's own policy (manifest rule MF5), and a person writing a test
6262
// against the file would otherwise meet that for the first time in the JSON.
6363
//
64+
// It names the outcomes with the SPELLING THE MANIFEST USES, and both halves
65+
// of that were wrong when this was written on 2026-09-23. It said "turn it
66+
// away" for an outcome the document calls reject, which is a second word for
67+
// a contract value somebody is about to read - and it left "sanitize" out
68+
// altogether, so the list promised three answers where the closed set has
69+
// four (internal/recipe: accept, reject, sanitize, unspecified). The first
70+
// half came from an outside review of #125, the second was found while
71+
// checking it. American spelling because that is the value, not a preference.
72+
//
6473
// A list of sentences rather than one paragraph per step: the window draws
6574
// these as the bullets the preset screen already uses for what a set
6675
// typically finds, so the three steps are read at a glance rather than read.
6776
func HowToUseSteps() []string {
6877
return []string{
6978
say("HowToUseChoose", "Choose a preset, or fill in one batch on the first screen."),
7079
say("HowToUsePress", "Press Generate. The files and a manifest land in the output folder."),
71-
say("HowToUseRead", "Point your test at the manifest. For every file it says what the system under test should do with it - accept it, turn it away, or leave the answer to the application's own policy."),
80+
say("HowToUseRead", "Point your test at the manifest. For every file it says what the system under test should do with it - accept it, reject it or sanitize it - or records the outcome as unspecified, where the right answer belongs to the application's own policy."),
7281
}
7382
}
7483

0 commit comments

Comments
 (0)