test(common): cover case-aware install detection and diff path normalization#311
Draft
cursor[bot] wants to merge 2 commits into
Draft
test(common): cover case-aware install detection and diff path normalization#311cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Contributor
|
Message that will be displayed on users' first pull request |
| (None, None), | ||
| ("", None), | ||
| (" ", None), | ||
| ("/tmp/kotor", "/tmp/kotor"), |
| (None, None), | ||
| ("", None), | ||
| (" ", None), | ||
| ("/tmp/kotor", "/tmp/kotor"), |
| ("", None), | ||
| (" ", None), | ||
| ("/tmp/kotor", "/tmp/kotor"), | ||
| ('"/tmp/kotor"', "/tmp/kotor"), |
| (" ", None), | ||
| ("/tmp/kotor", "/tmp/kotor"), | ||
| ('"/tmp/kotor"', "/tmp/kotor"), | ||
| ("'/tmp/kotor'", "/tmp/kotor"), |
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 regression tests for production paths changed in PR #151 (case-aware application) that were still untested on
master.Risky behavior now covered
is_kotor_install_dirin three call sites (diff_tool.cli_utils,tools.patching,tslpatcher.diff.engine): all now useCaseAwarePathto locatechitin.key. Wrong detection misroutes diff/patch/install flows.normalize_path_argindiff_tool.cli_utils: PowerShell quote-escape mangling ("concatenation) and embedded-quote stripping; bad parsing breaks CLI path inputs on Windows.Test files added
Libraries/PyKotor/tests/common/test_is_kotor_install_dir.py— 18 parametrized cases (6 scenarios × 3 checkers)Libraries/PyKotor/tests/common/test_diff_cli_utils.py— quote/whitespace/mangled-path normalizationWhy this reduces regression risk
Install detection is a gate for patching and diff against game trees; case mismatches on Linux/macOS were the motivation for PR #151 and are easy to break without targeted tests. Path normalization fixes real PowerShell failures; tests lock the intended behavior without environment-dependent GUI runs.
Validation
27 passed on Linux (POSIX case-mismatch tests; win32 skips case tests by design).