[Repo Assist] test: add 3 edge-case tests for findFiles depth/name priority and out-of-tree paths#118
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Conversation
…-tree paths - depth beats name-array order: child match wins even if listed later - name-array order respected when all candidates at the same level - returns null (or safe value) for an out-of-tree absolute directory path These tests document the interaction between depth-first traversal and name-array priority, which is a common source of confusion when multiple config file names exist at different levels of the directory tree. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
66 tasks
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 is an automated pull request from Repo Assist.
Summary
Adds 3 targeted edge-case tests to
test/unit.test.jsthat document and verify the interaction between depth-first traversal and name-array order priority infindFiles, plus an out-of-tree path robustness check.New Tests
depth beats name-array ordername-array order respected at same levelreturns null for out-of-tree absolute directoryparentreturnsnullor a safe absolute path — no crashMotivation
These behaviors are implicit in the code but were not previously documented by tests. The depth-vs-name-order interaction is a common source of confusion when multiple phpcs config file names (e.g.,
phpcs.xmland.phpcs.xml) exist at different directory levels.These tests complement the existing 7 tests and the open PR #113 (which tests
empty-names,name-priority, anddepth-priorityfrom a different angle).Test Status
All 10 tests pass (7 existing + 3 new).