@@ -400,8 +400,8 @@ TEST(incr_modify_file) {
400400
401401 /* Single-file incremental should be faster than full */
402402 if ((int )ms > (int )(g_full_index_ms * 1.5 )) {
403- printf (" [PERF WARNING] incremental slower than 1.5x full: %.0fms vs %.0fms\n" ,
404- ms , g_full_index_ms );
403+ printf (" [PERF WARNING] incremental slower than 1.5x full: %.0fms vs %.0fms\n" , ms ,
404+ g_full_index_ms );
405405 }
406406
407407 printf (" [perf] modify 1 file: %.0fms (full was %.0fms)\n" , ms , g_full_index_ms );
@@ -910,12 +910,12 @@ static int resp_lacks_key(const char *resp, const char *key) {
910910}
911911
912912/* Helper: assert tool call succeeds, warn if slow */
913- #define TOOL_OK (resp , ms ) \
914- do { \
915- ASSERT((resp) != NULL); \
916- if ((int)(ms) > PERF_WARN_MS) { \
913+ #define TOOL_OK (resp , ms ) \
914+ do { \
915+ ASSERT((resp) != NULL); \
916+ if ((int)(ms) > PERF_WARN_MS) { \
917917 printf(" [PERF WARNING] tool call: %.0fms (>%dms)\n", (ms), PERF_WARN_MS); \
918- } \
918+ } \
919919 } while (0)
920920
921921/* Helper: assert response is not an error */
@@ -932,6 +932,38 @@ TEST(tool_list_projects_basic) {
932932 PASS ();
933933}
934934
935+ TEST (tool_qg_defines_method_more_than_10 ) {
936+ write_file_at ("fastapi/big_class.py" , "class BigClass:\n"
937+ " def m1(self): pass\n"
938+ " def m2(self): pass\n"
939+ " def m3(self): pass\n"
940+ " def m4(self): pass\n"
941+ " def m5(self): pass\n"
942+ " def m6(self): pass\n"
943+ " def m7(self): pass\n"
944+ " def m8(self): pass\n"
945+ " def m9(self): pass\n"
946+ " def m10(self): pass\n"
947+ " def m11(self): pass\n"
948+ " def m12(self): pass\n"
949+ " def m13(self): pass\n"
950+ " def m14(self): pass\n"
951+ " def m15(self): pass\n" );
952+ char * idx = index_repo ();
953+ ASSERT (idx != NULL );
954+ free (idx );
955+ double ms ;
956+ char * r = call_tool_timed ("query_graph" , & ms ,
957+ "{\"project\":\"%s\","
958+ "\"query\":\"MATCH (c:Class)-[:DEFINES_METHOD]->(m:Method)"
959+ " WHERE c.name = 'BigClass' RETURN count(m) AS n\"}" ,
960+ g_project );
961+ TOOL_OK (r , ms );
962+ ASSERT (strstr (r , "\"15\"" ) != NULL || strstr (r , "\\\"15\\\"" ) != NULL );
963+ free (r );
964+ PASS ();
965+ }
966+
935967TEST (tool_list_projects_has_current ) {
936968 double ms ;
937969 char * r = call_tool_timed ("list_projects" , & ms , "{}" );
@@ -3042,6 +3074,7 @@ SUITE(incremental) {
30423074 RUN_TEST (tool_qg_configures );
30433075 RUN_TEST (tool_qg_handles );
30443076 RUN_TEST (tool_qg_defines_method );
3077+ RUN_TEST (tool_qg_defines_method_more_than_10 );
30453078 RUN_TEST (tool_qg_no_limit );
30463079 RUN_TEST (tool_qg_empty_result );
30473080
0 commit comments