Finish three comments a build could never have checked, since a compiler does not read prose

This commit is contained in:
heaven 2026-09-06 07:03:40 +03:00
parent 7138a4a24f
commit f1e9226b97
3 changed files with 6 additions and 4 deletions

View file

@ -56,7 +56,7 @@ type Book struct {
Description string
// Notice are the book-level paragraphs a reader sees on OPENING the book — before the first chapter's
// title, inside the first spine document (a separate title document would be read by ingest as a
// chapter of its own), and at the head of the text file. Empty for a book with nothing to declare.
// chapter of its own — before the reader learned to fold an uncovered leading document into chapter one), and at the head of the text file. Empty for a book with nothing to declare.
Notice []string
// Chapters in reading order; at least one (an EPUB with an empty spine is not an EPUB).
Chapters []Chapter

View file

@ -574,7 +574,8 @@ func TestExtractXHTMLRejectsNonUTF8Charset(t *testing.T) {
func TestIngestEPUBPercentEncodedHref(t *testing.T) {
// Real epubs percent-encode non-ASCII (and spaced) filenames in the manifest while the zip
// entry carries the decoded name. Without resolveHref's url.PathUnescape the entry is missed
// entry carries the decoded name. Without the percent-decode in hrefTarget (which resolveHref wraps)
// the entry is missed
// and ingest fails loud on a chapter that is actually present.
chapters := []chunktest.Chapter{
{ID: "c1", Href: "%E7%AC%AC%E4%B8%80%E7%AB%A0.xhtml", EntryName: "第一章.xhtml", Body: `<p>第一章。</p>`},

View file

@ -19,8 +19,9 @@ func TestEveryIngestCountReachesTheAlarm(t *testing.T) {
f := rt.Field(i)
d := &Document{Chapters: []string{"x"}}
fv := reflect.ValueOf(d).Elem().Field(i)
// Every field that carries an alarm, whatever its type. Restricting this to ints is how the guard
// would quietly stop covering a count the day one grows into a list.
// The field types that carry an alarm TODAY: ints, and the one slice a count grew into. ⚠ This switch
// is the guard's OWN limit — a counter of any other type falls into `default` and is skipped silently,
// so a new alarm field must be added here as well as to IngestNotes.
switch {
case f.Type.Kind() == reflect.Int:
fv.SetInt(1)