@@ -134,6 +134,43 @@ TEST_SUITE("execute_request")
134134        REQUIRE (result[" status" " ok" 
135135    }
136136
137+     TEST_CASE (" fetch_documentation_of_member_or_parameter" 
138+     {
139+         std::vector<const  char *> Args = {/* "-v", "resource-dir", "....."*/ 
140+         xcpp::interpreter interpreter ((int )Args.size (), Args.data ());
141+ 
142+         std::string code = " ?std::vector.push_back" 
143+         std::string inspect_result = " https://en.cppreference.com/w/cpp/container/vector/push_back" 
144+         nl::json user_expressions = nl::json::object ();
145+         xeus::execute_request_config config;
146+         config.silent  = false ;
147+         config.store_history  = false ;
148+         config.allow_stdin  = false ;
149+         nl::json header = nl::json::object ();
150+         xeus::xrequest_context::guid_list id = {};
151+         xeus::xrequest_context context (header, id);
152+ 
153+         std::promise<nl::json> promise;
154+         std::future<nl::json> future = promise.get_future ();
155+         auto  callback = [&promise](nl::json result) {
156+             promise.set_value (result);
157+         };
158+ 
159+         interpreter.execute_request (
160+             std::move (context),
161+             std::move (callback),
162+             code,
163+             std::move (config),
164+             user_expressions
165+         );
166+         nl::json result = future.get ();
167+         REQUIRE (result[" payload" 0 ][" data" " text/plain" 
168+         REQUIRE (result[" user_expressions" nl::json::object ());
169+         REQUIRE (result[" found" true );
170+         REQUIRE (result[" status" " ok" 
171+     }
172+ 
173+ 
137174    TEST_CASE (" bad_status" 
138175    {
139176        std::vector<const  char *> Args = {" resource-dir" 
@@ -861,6 +898,14 @@ TEST_SUITE("xinspect"){
861898        cmp.child_value  = " nonexistentMethod" 
862899        REQUIRE (cmp (node) == false );
863900    }
901+ 
902+     TEST_CASE (" is_inspect_request" 
903+         std::string code = " vector" 
904+         std::regex re_expression (R"( non_matching_pattern)" 
905+         std::pair<bool , std::smatch> result = xcpp::is_inspect_request (code, re_expression);
906+         REQUIRE (result.first  == false );
907+     }
908+ 
864909}
865910
866911#if  !defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
0 commit comments