test: remove vacuous guard tests and duplicate URL-encoding tests in wiki safe outputs#844
Merged
Conversation
…wiki safe outputs - create_wiki_page.rs: remove test_page_already_exists_guard_returns_failure and test_new_page_passes_guard — both tests construct a local if/else conditional inline and assert on the result; they never call execute_impl or any production code. The doc-comments themselves note 'if the guard were accidentally removed from execute_impl, this test would still pass.' - update_wiki_page.rs: remove test_page_not_found_guard_returns_failure and test_existing_page_passes_guard — same vacuous pattern. - update_wiki_page.rs: remove test_path_segment_encodes_fragment_delimiter, test_path_segment_encodes_query_delimiter, test_path_segment_encodes_space, test_path_segment_does_not_encode_safe_chars — identical copies of the same four tests already present in create_wiki_page.rs; both modules use the same PATH_SEGMENT constant from super::. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Test Suite Reduction: wiki safe outputs
What was wrong
create_wiki_page.rs::test_page_already_exists_guard_returns_failure: Constructs a localif page_exists { ... } else { None }conditional inline and asserts on that local value — never callsexecute_implor any production code. The doc-comment even says explicitly: "if the guard were accidentally removed from execute_impl, this test would still pass."create_wiki_page.rs::test_new_page_passes_guard: Same vacuous pattern (page_exists = false, local conditional,assert!(result.is_none())).update_wiki_page.rs::test_page_not_found_guard_returns_failure: Same pattern as above.update_wiki_page.rs::test_existing_page_passes_guard: Same pattern.update_wiki_page.rs— 4×test_path_segment_*tests: Exact duplicates of identical tests already present increate_wiki_page.rs. Both modules import the samePATH_SEGMENTconstant fromsuper::, so these tests cover no additional code paths.Changes
test_page_already_exists_guard_returns_failurecreate_wiki_page.rstest_new_page_passes_guardcreate_wiki_page.rstest_page_not_found_guard_returns_failureupdate_wiki_page.rstest_existing_page_passes_guardupdate_wiki_page.rstest_path_segment_encodes_fragment_delimiterupdate_wiki_page.rscreate_wiki_page.rstest_path_segment_encodes_query_delimiterupdate_wiki_page.rstest_path_segment_encodes_spaceupdate_wiki_page.rstest_path_segment_does_not_encode_safe_charsupdate_wiki_page.rsVerification
cargo test: all 1751 unit tests + all integration tests pass, 0 failed ✅cargo clippy --all-targets --all-features: no warnings or errors ✅Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comspsprodweu4.vssps.visualstudio.comSee Network Configuration for more information.