Reminder: a fold that would cut a character, tested

A name whose ñ falls on the 75th octet of the SUMMARY line: the line
folds before it, at 74, and the continuation starts with the ñ. The
TypeScript port of the reminder needed this case to cover the step back
of the fold; Go has it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.16
dev 3 hours ago
parent 7e6a03d464
commit 92f8cdc50c

@ -57,6 +57,12 @@ func TestReminderICS(t *testing.T) {
t.Errorf("a line of %d octets: %q", len(line), line)
}
}
// SUMMARY and the start of the text take 49 octets: with 25 more, ñ takes
// octets 75 and 76, and the line folds before it, at 74.
r.Name = strings.Repeat("x", 25) + "ñ.dkc"
if want := "SUMMARY:Ya se puede abrir la cápsula DateKeys «" + strings.Repeat("x", 25) + "\r\n ñ.dkc»\r\n"; !strings.Contains(r.ics(), want) {
t.Errorf("a fold that would cut ñ:\n%s", r.ics())
}
if id, err := newUID(); err != nil || len(id) != 36 || id[14] != '4' || !strings.ContainsRune("89ab", rune(id[19])) {
t.Errorf("a UUID of version 4: %q, %v", id, err)
}

Loading…
Cancel
Save

Powered by TurnKey Linux.