You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During review of PR #294, the following gaps in src/manifest/expand_tests.rs were identified. Addressing them is out of scope for that documentation-and-expansion PR.
Work Required
File to edit: src/manifest/expand_tests.rs
In expand_foreach_expands_sequence_values (Test 1), after confirming targets.len() == 2, add an assertion for each expanded target that its object map does not contain the key "foreach".
In expand_foreach_applies_when_expression (Test 2), after confirming the filtered count, add an assertion for each remaining target that its object map does not contain the key "foreach".
In expand_foreach_applies_action_when_expression (Test 4), after confirming the filtered count, add an assertion for each remaining action that its object map does not contain the key "foreach".
Add a test expand_foreach_empty_foreach_produces_no_entries that passes a target with foreach: [] and asserts the expanded targets slice is empty.
Add a test expand_foreach_non_object_entry_is_passed_through that passes a targets array containing a bare string value (non-object) and asserts it survives unexpanded.
Add a test expand_foreach_iteration_vars_do_not_overwrite_globals that passes a target whose vars map already contains a key "item" with a value, and asserts the iteration-injected item value (from foreach) takes precedence for each expanded entry (or whichever precedence rule expand_section implements — assert the actual observed behaviour).
Add a test expand_foreach_jinja_filter_in_name that passes a target whose name uses a Jinja filter (e.g. {{ item | upper }}) with a foreach list of lowercase strings and asserts the expanded names are uppercased correctly.
Do not remove or modify any existing tests.
AI Agent Prompt
File to edit: src/manifest/expand_tests.rs
1. In `expand_foreach_expands_sequence_values` (Test 1), after confirming
`targets.len() == 2`, add an assertion for each expanded target that its
object map does not contain the key `foreach`.
2. In `expand_foreach_applies_when_expression` (Test 2), after confirming
the filtered count, add an assertion for each remaining target that its
object map does not contain the key `foreach`.
3. In `expand_foreach_applies_action_when_expression` (Test 4), after
confirming the filtered count, add an assertion for each remaining action
that its object map does not contain the key `foreach`.
4. Add a test `expand_foreach_empty_foreach_produces_no_entries` that
passes a target with `foreach: []` and asserts the expanded `targets`
slice is empty.
5. Add a test `expand_foreach_non_object_entry_is_passed_through` that
passes a `targets` array containing a bare string value (non-object) and
asserts it survives unexpanded.
6. Add a test `expand_foreach_iteration_vars_do_not_overwrite_globals` that
passes a target whose `vars` map already contains a key `item` with a
value, and asserts the iteration-injected `item` value (from `foreach`)
takes precedence for each expanded entry (or whichever precedence rule
`expand_section` implements — assert the actual observed behaviour).
7. Add a test `expand_foreach_jinja_filter_in_name` that passes a target
whose `name` uses a Jinja filter (e.g. `{{ item | upper }}`) with a
`foreach` list of lowercase strings and asserts the expanded names are
uppercased correctly.
Do not remove or modify any existing tests.
The tests have since moved from src/manifest/expand_tests.rs into src/manifest/expand_test_cases/. Progress against the numbered items:
Items 1–3 (foreach-key-removal assertions): done — !map.contains_key("foreach") assertions exist in expand_test_cases/action_condition_cases.rs:27 and condition_cases.rs:88, and the proptest foreach_key_is_removed_from_all_entries (property_cases.rs:97, merged via Add proptest property tests for expand_foreach (#295) #359) covers the invariant generally.
Item 6 (iteration vars vs entry vars): effectively covered by expand_foreach_when_item_overrides_entry_vars (condition_cases.rs:126).
Items 4, 5, and 7 (empty foreach, non-object passthrough, Jinja filter in name): outstanding — no such tests exist under src/manifest/. PR Extend expand_foreach test coverage (#296) #358 is in flight to cover these.
Background
During review of PR #294, the following gaps in
src/manifest/expand_tests.rswere identified. Addressing them is out of scope for that documentation-and-expansion PR.Work Required
File to edit:
src/manifest/expand_tests.rsIn
expand_foreach_expands_sequence_values(Test 1), after confirmingtargets.len() == 2, add an assertion for each expanded target that its object map does not contain the key"foreach".In
expand_foreach_applies_when_expression(Test 2), after confirming the filtered count, add an assertion for each remaining target that its object map does not contain the key"foreach".In
expand_foreach_applies_action_when_expression(Test 4), after confirming the filtered count, add an assertion for each remaining action that its object map does not contain the key"foreach".Add a test
expand_foreach_empty_foreach_produces_no_entriesthat passes a target withforeach: []and asserts the expandedtargetsslice is empty.Add a test
expand_foreach_non_object_entry_is_passed_throughthat passes atargetsarray containing a bare string value (non-object) and asserts it survives unexpanded.Add a test
expand_foreach_iteration_vars_do_not_overwrite_globalsthat passes a target whosevarsmap already contains a key"item"with a value, and asserts the iteration-injecteditemvalue (fromforeach) takes precedence for each expanded entry (or whichever precedence ruleexpand_sectionimplements — assert the actual observed behaviour).Add a test
expand_foreach_jinja_filter_in_namethat passes a target whosenameuses a Jinja filter (e.g.{{ item | upper }}) with aforeachlist of lowercase strings and asserts the expanded names are uppercased correctly.Do not remove or modify any existing tests.
AI Agent Prompt
Raised By
@leynos — identified during review of PR #294 (#294).
Rescope (2026-08-12)
The tests have since moved from
src/manifest/expand_tests.rsintosrc/manifest/expand_test_cases/. Progress against the numbered items:!map.contains_key("foreach")assertions exist inexpand_test_cases/action_condition_cases.rs:27andcondition_cases.rs:88, and the proptestforeach_key_is_removed_from_all_entries(property_cases.rs:97, merged via Add proptest property tests for expand_foreach (#295) #359) covers the invariant generally.expand_foreach_when_item_overrides_entry_vars(condition_cases.rs:126).foreach, non-object passthrough, Jinja filter inname): outstanding — no such tests exist undersrc/manifest/. PR Extend expand_foreach test coverage (#296) #358 is in flight to cover these.