diff options
| author | Mohamed Hegazy <mhegazy@anthropic.com> | 2026-10-19 20:56:09 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-10-19 20:56:09 +0000 |
| commit | ca69dcab87c6e23e4080d6c0368c93023d24498d (patch) | |
| tree | af4d1b145bdf60116a899f4a9fda264b60c63136 /plugins | |
| parent | 6d551545b1c5e4df76649cfd365f79b20de36020 (diff) | |
security-guidance: let the lone-surrogate path test pass on Windows
Windows file names can hold a lone surrogate, so the path the test uses as
unreadable is an ordinary file in the repo there and the Stop row carries
review_scope. Elsewhere the path cannot be encoded and the key is left out,
as before.
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/security-guidance/tests/test_stop_scope_metrics.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/security-guidance/tests/test_stop_scope_metrics.py b/plugins/security-guidance/tests/test_stop_scope_metrics.py index 5d364ef0..c65103b6 100644 --- a/plugins/security-guidance/tests/test_stop_scope_metrics.py +++ b/plugins/security-guidance/tests/test_stop_scope_metrics.py @@ -106,7 +106,13 @@ class TestScope: _, repo = workspace m = _turn(repo, hook_env, edits=[str(repo / "a\ud800b.py"), repo / "app.py"], during=lambda: (repo / "app.py").write_text(VULN_PY)) - assert m["files_reviewed"] == 1 and "review_scope" not in m + assert m["files_reviewed"] == 1 + if os.name == "nt": + # Windows paths can hold a lone surrogate: it is one more file + # in the repo. + assert m["review_scope"] == 10000 + else: + assert "review_scope" not in m class TestSnapshot: |
