The 5h/7d bars were served from a cache with a one-hour TTL, so a bar could sit unchanged for most of a 5-hour window. The TTL is now a named config setting next to GIT_CACHE_SECS at 300s: worst case 12 requests an hour, shared across every session through /tmp/claude. The section header claimed "cached 60s" — inherited from upstream and never true here — which is what set the expectation the code did not meet. It now names the setting instead of a number that can drift. The refresh is gated on the same width-tier check as the bars, so a render that shows them is a render that refreshes them: the new tests pin that from full width down to WRAP_FLOOR, and pin that one column below it, where the bars are dropped, no request is paid for either. Those widths are given in usable columns, as in the sibling width test, so the suite does not depend on the padding in the live settings.json. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
26 lines
824 B
Shell
Executable file
26 lines
824 B
Shell
Executable file
#!/bin/bash
|
|
# Run every test for claude/statusline.isaacaudet.sh.
|
|
#
|
|
# Usage: claude/tests/run.sh
|
|
#
|
|
# The tests render the status line directly, so they need the same tools it
|
|
# does (bash, jq, git, python3). They point STATUSLINE_CACHE_DIR at a temporary
|
|
# directory and write their fixtures there, so the caches the live status line
|
|
# reads are never touched.
|
|
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
|
|
|
|
status=0
|
|
for t in statusline.isaacaudet.payload_test.sh \
|
|
statusline.isaacaudet.width_test.sh \
|
|
statusline.isaacaudet.cache_test.sh; do
|
|
echo "== $t"
|
|
bash "$t" || status=1
|
|
echo
|
|
done
|
|
|
|
echo "== statusline.isaacaudet.overflow_test.py"
|
|
python3 statusline.isaacaudet.overflow_test.py || status=1
|
|
|
|
echo
|
|
[ "$status" -eq 0 ] && echo "ALL TESTS PASSED" || echo "SOME TESTS FAILED"
|
|
exit "$status"
|