test: pin _adaptive_sim_duration_ms boundary and constants#66
Draft
madara88645 wants to merge 1 commit into
Draft
test: pin _adaptive_sim_duration_ms boundary and constants#66madara88645 wants to merge 1 commit into
madara88645 wants to merge 1 commit into
Conversation
Pins the boundary condition (60-char threshold → 500 ms vs 1 000 ms simulation window) and the three constants that govern the behaviour. A silent change to any constant would alter visual output for all users without a type error; these 9 tests make that change visible immediately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 9 unit tests for
_adaptive_sim_duration_msinbackend/main.py— the only pure helper in that module not yet covered by the test suite.What the function does: decides the Brian2 simulation window length (500 ms vs 1 000 ms) based on prompt character count against a 60-char threshold.
Why it matters: the three constants (
SIM_SHORT_PROMPT_CHAR_THRESHOLD,SIM_DURATION_MS_SHORT,SIM_DURATION_MS_DEFAULT) and the<=boundary condition are silently load-bearing — changing any of them shifts the visual output for every user without a type error or test failure. These tests pin that contract.What's covered
SIM_DURATION_MS_SHORT(500)SIM_DURATION_MS_SHORTSIM_DURATION_MS_DEFAULT(1 000)SIM_DURATION_MS_DEFAULTFiles changed
tests/test_adaptive_sim_duration.py(new — 57 lines, no source changes)Test run
Generated by Claude Code