@@ -202,7 +202,7 @@ def test_multi_member_add_only_and_collisions(multi, tmp_path):
202202
203203
204204@pytest .mark .parametrize ("mode" , ["single" , "multi" ])
205- @pytest .mark .parametrize ("shape" , ["commented-header" , "quoted-key" , "quoted-nested" , "commented-control" , "owner-flow" , "owner-comment" ])
205+ @pytest .mark .parametrize ("shape" , ["commented-header" , "anchored-header" , " quoted-key" , "quoted-nested" , "commented-control" , "owner-flow" , "owner-comment" ])
206206@pytest .mark .parametrize ("dependency_free" , [False , True ])
207207def test_member_add_preserves_yaml_section_boundaries (multi , tmp_path , monkeypatch , mode , shape , dependency_free ):
208208 config , workspace , remote = multi
@@ -212,6 +212,8 @@ def test_member_add_preserves_yaml_section_boundaries(multi, tmp_path, monkeypat
212212 text = metadata .read_text ()
213213 if shape == "commented-header" :
214214 text = text .replace ("source_repositories:" , "source_repositories: # managed members" )
215+ elif shape == "anchored-header" :
216+ text = text .replace ("source_repositories:" , "source_repositories: &sources" )
215217 elif shape == "quoted-key" :
216218 text = text .replace ("prefer_subagent:" , "'custom_owner_field': retained\n prefer_subagent:" )
217219 elif shape == "quoted-nested" :
@@ -245,6 +247,8 @@ def test_member_add_preserves_yaml_section_boundaries(multi, tmp_path, monkeypat
245247 assert document ["custom_owner_field" ] == "retained"
246248 elif shape == "commented-header" :
247249 assert "source_repositories: # managed members" in metadata .read_text ()
250+ elif shape == "anchored-header" :
251+ assert "source_repositories: &sources" in metadata .read_text ()
248252 elif shape == "commented-control" :
249253 assert "control_plane: # portable settings" in metadata .read_text ()
250254 elif shape == "owner-comment" :
0 commit comments