@@ -854,68 +854,6 @@ wiki-name: "MyProject.wiki"
854854 // path-not-found guard is reachable; the no-network path verifies the
855855 // guard logic via the unit test below.
856856 let _ = result. execute_impl ( & ctx) . await ;
857- // (we cannot assert success/failure here without a real server;
858- // the guard itself is exercised by test_page_not_found_guard_returns_failure)
859- }
860-
861- /// Unit test for the page-not-found guard (no HTTP call needed).
862- #[ test]
863- fn test_page_not_found_guard_returns_failure ( ) {
864- // Simulate the logic that replaced check_create_if_missing_guard:
865- // if !page_exists → failure.
866- let page_exists = false ;
867- let effective_path = "/Agent/Page" ;
868- let result = if !page_exists {
869- Some ( ExecutionResult :: failure ( format ! (
870- "Wiki page '{effective_path}' does not exist. \
871- Use a separate safe output to create new pages."
872- ) ) )
873- } else {
874- None
875- } ;
876- assert ! ( result. is_some( ) ) ;
877- assert ! ( !result. unwrap( ) . success) ;
878- }
879-
880- /// Confirm that an existing page (page_exists = true) proceeds past the guard.
881- #[ test]
882- fn test_existing_page_passes_guard ( ) {
883- let page_exists = true ;
884- let effective_path = "/Agent/Page" ;
885- let result: Option < ExecutionResult > = if !page_exists {
886- Some ( ExecutionResult :: failure ( format ! (
887- "Wiki page '{effective_path}' does not exist. \
888- Use a separate safe output to create new pages."
889- ) ) )
890- } else {
891- None
892- } ;
893- assert ! ( result. is_none( ) ) ;
894- }
895-
896- // ── URL encoding ──────────────────────────────────────────────────────────
897-
898- #[ test]
899- fn test_path_segment_encodes_fragment_delimiter ( ) {
900- let encoded = utf8_percent_encode ( "wiki#name" , PATH_SEGMENT ) . to_string ( ) ;
901- assert_eq ! ( encoded, "wiki%23name" ) ;
902- }
903-
904- #[ test]
905- fn test_path_segment_encodes_query_delimiter ( ) {
906- let encoded = utf8_percent_encode ( "wiki?name" , PATH_SEGMENT ) . to_string ( ) ;
907- assert_eq ! ( encoded, "wiki%3Fname" ) ;
908- }
909-
910- #[ test]
911- fn test_path_segment_encodes_space ( ) {
912- let encoded = utf8_percent_encode ( "My Project" , PATH_SEGMENT ) . to_string ( ) ;
913- assert_eq ! ( encoded, "My%20Project" ) ;
914- }
915-
916- #[ test]
917- fn test_path_segment_does_not_encode_safe_chars ( ) {
918- let encoded = utf8_percent_encode ( "MyProject.wiki" , PATH_SEGMENT ) . to_string ( ) ;
919- assert_eq ! ( encoded, "MyProject.wiki" ) ;
857+ // (we cannot assert success/failure here without a real server)
920858 }
921859}
0 commit comments