Fix test naming convention in agents, terminal, editor#610
Merged
Conversation
Update `define_agent_backend!` macro to generate test names that follow the `<subject>_<expected_behavior>` convention using `paste` for ident concatenation (e.g. `amp_backend_returns_correct_name`). Rename trait test functions: - `test_agent_backend_basic_methods` → `mock_agent_backend_delegates_name_display_and_yolo_correctly` - `test_terminal_backend_basic_methods` → `mock_terminal_backend_name_and_availability_are_accessible` - `test_editor_backend_basic_methods` → `mock_editor_backend_is_available_and_not_a_terminal_editor` Closes #523
Move `paste` from production to dev/test section in workspace Cargo.toml to match `temp-env` placement convention. Rename remaining sibling tests that were missed in the initial pass: - test_terminal_backend_execute_spawn → mock_terminal_backend_execute_spawn_returns_window_title - test_terminal_backend_close_window → mock_terminal_backend_close_window_does_not_panic - test_editor_backend_open → mock_editor_backend_open_succeeds
Address review agent findings: - Extract 4 shared test functions into define_agent_backend_tests! helper macro, eliminating ~30 lines of duplication between the two arms - Update module doc comment to reflect the new test_prefix parameter - Trim redundant return-type clause from terminal close_window test comment
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
define_agent_backend!macro to generate test names following<subject>_<expected_behavior>convention (e.g.amp_backend_returns_correct_nameinstead oftest_name) usingpastecrate for identifier concatenationtest_*_backend_basic_methods→ descriptive behavioral names) inagents/traits.rs,terminal/traits.rs,editor/traits.rsTest plan
cargo fmt --checkcleancargo clippy --all -- -D warningscleanCloses #523