Skip to content

test(config): pin the exact cache_ttl rejection messages - #76

Merged
aaearon merged 1 commit into
mainfrom
test/pin-cache-ttl-message
Aug 23, 2026
Merged

aaearon merged 1 commit into
mainfrom
test/pin-cache-ttl-message

Conversation

@aaearon

@aaearon aaearon commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Closes the one open Low from the pre-release Codex review.

The rejection message was asserted only by substrings, so punctuation, ordering and — critically — whether DefaultCacheTTL is genuinely interpolated rather than hardcoded could all drift silently.

Adds TestParseCacheTTL_RejectionMessagesAreExact, comparing the whole err.Error() against a literal built from DefaultCacheTTL.String().

Mutation-verified: changing "remove the setting to use the default" to "...to use default" fails 2 of 2 subtests; reverting passes. The existing substring cases are kept — they document intent, this pins the text.

Deliberately brittle, and that is the point: this string is the user's only instruction for repairing the config by hand, and it has already been wrong once (it named --refresh, a flag three cache-consuming commands do not have).

@aaearon
aaearon merged commit ffb33bc into main Aug 23, 2026
2 checks passed
@aaearon
aaearon deleted the test/pin-cache-ttl-message branch August 23, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant