[Repo Assist] test: add coverage for ensure_selection_visible branches and csv_escape#152
Draft
github-actions[bot] wants to merge 1 commit intomainfrom
Draft
Conversation
Add tests for three previously uncovered code paths in app.rs: - ensure_selection_visible_scrolls_viewport_up: selection above the visible window (selected < offset) was the only un-exercised branch of ensure_selection_visible. - ensure_selection_visible_already_visible_is_noop: verifies the function leaves offset unchanged when the selection is in-view. - csv_escape_*: four unit tests for the pure csv_escape helper (plain string, comma, embedded quote, newline), which had no direct tests despite being called in the CSV export path. 230 → 236 tests; all passing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 25, 2026
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
What
Adds 6 targeted tests to
src/app.rsthat complete branch coverage for two existing functions:ensure_selection_visible(3 new tests)Previously only the scroll-down path was tested. This PR adds:
ensure_selection_visible_scrolls_viewport_upselected < offset→ scroll upensure_selection_visible_already_visible_is_noopensure_selection_visible_scrolls_viewport_downselected ≥ offset + viewport→ scroll downcsv_escape(4 new tests)The
csv_escapehelper is a pure function called in the export path but had no direct unit tests:csv_escape_plain_string_is_unchangedcsv_escape_string_with_comma_is_quoted"..."csv_escape_embedded_quote_is_doubled"→""inside wrapping quotescsv_escape_newline_triggers_quoting\n→ wrap in"..."Test Status
No production code changed.
Note
🔒 Integrity filter blocked 1 item
The following item were blocked because they don't meet the GitHub integrity level.
list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter: