From d2f546b5cd5dc9c17a538ed127519002d49c1ad8 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Fri, 31 Jul 2026 17:29:35 -0600 Subject: [PATCH] test(rust): pin the SPL guard's member-inheritance boundary Adds a passing case for a member entry that renames an inherited SPL dependency (package set, workspace = true, no source or selector keys). It is accepted because the entry draws its source and tag from the workspace pin and its lockfile record is keyed by the real package name, so both remain governed by the existing workspace and lockfile checks. Records that boundary as an invariant so the guard is not later tightened into a false positive. Removes an unused test helper. --- tests/test_spl_dependency_pin_guard.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/test_spl_dependency_pin_guard.py b/tests/test_spl_dependency_pin_guard.py index a1315b417..9d62ec366 100644 --- a/tests/test_spl_dependency_pin_guard.py +++ b/tests/test_spl_dependency_pin_guard.py @@ -36,10 +36,6 @@ def _write(repo: Path, rel_path: str, text: str) -> None: path.write_text(text, encoding="utf-8") -def _read(repo: Path, rel_path: str) -> str: - return (repo / rel_path).read_text(encoding="utf-8") - - def _replace(repo: Path, rel_path: str, old: str, new: str) -> None: path = repo / rel_path source = path.read_text(encoding="utf-8") @@ -173,6 +169,24 @@ def test_valid_repo_passes_with_derived_second_tag( assert captured.err == "" +def test_member_workspace_inheritance_with_rename_is_accepted( + tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: + repo = _write_valid_repo(tmp_path) + # The local rename inherits the workspace pin; W and L still govern source, tag, and lock binding. + _append( + repo, + "core/crates/member/Cargo.toml", + 'myspl = { package = "spl-core", workspace = true }\n', + ) + + exit_code = _run_guard(repo) + + captured = capsys.readouterr() + assert exit_code == 0 + assert captured.err == "" + + def test_python_spl_surfaces_do_not_trip_in_tree_package_copy( tmp_path: Path, capsys: pytest.CaptureFixture[str] ) -> None: -- 2.51.2