mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
Covers the Lua script logic (ZADD + lazy TTL expiry + capacity trim) via in-process miniredis — no Docker required, runs under `go test -tags unit`. 10 cases: basic add/topN, fewer-than-N, empty bucket, capacity trim to newest 3, lazy expiry on Add, TopN-does-not-filter-by-TTL (design rule: stale sigs survive until next Add), duplicate score update, empty-input noop, zero-N guard, Size accuracy. Also keeps the integration test file (build tag `integration`) for environments with Docker + testcontainers.