Trim comments to the non-obvious why
Drop narration, history and restated-code comments across the repo, keep short ones for security boundaries, upstream quirks and ordering constraints, and record the convention in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -8,18 +8,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Covered here: the pure logic in ratelimit.go, notes.go and gitea.go —
|
||||
// sliding-window arithmetic, the path-traversal guard, and the two-stage JSON
|
||||
// decoding of a Gitea feed entry (from a hand-written fixture).
|
||||
//
|
||||
// Deliberately not covered:
|
||||
// - FetchLatestFeed: it is an HTTP call to the Gitea container. Its only
|
||||
// logic beyond the request is the empty-feed nil,nil case, and testing it
|
||||
// would mean either a network or an injected client that does not exist.
|
||||
// - The 1-minute Gitea cache TTL: it lives in handlers.Store, not here.
|
||||
// - RateLimiter's window expiry uses the real clock (Allow calls time.Now
|
||||
// directly and there is no injectable clock), so the expiry case below
|
||||
// uses a deliberately tiny window rather than a long sleep.
|
||||
// Expiry uses the real clock, hence the tiny window.
|
||||
|
||||
func TestRateLimiterAllow(t *testing.T) {
|
||||
t.Run("calls up to max are allowed", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user