Add test coverage for refactored filepath candidate functions#156
Merged
Add test coverage for refactored filepath candidate functions#156
Conversation
Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Work in progress to enhance candidate filepath list
Add test coverage for refactored filepath candidate functions
Feb 4, 2026
tninja
added a commit
that referenced
this pull request
Feb 5, 2026
* visible files logic support out of repo file * Normalize file paths and improve relative path handling * Refactor buffer file list to helper functions for clarity * Add recent buffer paths to git root candidate paths list * Include Dired directories when collecting recent file paths * Update ai-code-prompt-mode.el Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * reorder menu * Add test coverage for refactored filepath candidate functions (#156) * Initial plan * Add tests for refactored helper functions and behaviors Co-authored-by: tninja <714625+tninja@users.noreply.github.com> * Fix trailing whitespace in test Co-authored-by: tninja <714625+tninja@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tninja <714625+tninja@users.noreply.github.com> * Update ai-code-prompt-mode.el Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
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.
PR #155 removed three tests during refactoring but the underlying behaviors still needed verification. This PR restores test coverage adapted to the new implementation.
Tests Added
Helper function coverage:
ai-code--normalize-path- path normalization for existing/non-existing filesai-code--candidate-path- relative (@-prefixed) paths for in-repo files, absolute paths for out-of-repo filesai-code--visible-window-files- file retrieval without git repo filtering (new behavior)ai-code--recent-buffer-paths- recent buffer collection with candidate formattingai-code--current-frame-dired-paths- dired directory extractionIntegration behavior coverage:
Example Test Structure
Total: 9 test cases added covering all refactored functions and their integration behaviors.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.