MCPcopy Create free account
hub / github.com/antirez/ds4 / worker_accept_generated_token

Function worker_accept_generated_token

ds4_agent.c:7523–7549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7521 "clean:\n"
7522 "\trm -f bc\n";
7523 const char *old =
7524 "CFLAGS = -Wall -Wextra -g\n"
7525 "LDFLAGS =\n"
7526 "\n"
7527 "all: bc\n"
7528 "\n"
7529 "bc: main.c\n"
7530 "\t$(CC) $(CFLAGS) -o bc main.c $(LDFLAGS)\n"
7531 "\n"
7532 "[upto]\n"
7533 "clean:\n";
7534
7535 const char *match = NULL;
7536 size_t match_len = 0;
7537 bool anchored = false;
7538 char err[128] = {0};
7539 AGENT_TEST_ASSERT(!agent_edit_find_old_span(data, strlen(data), old, false,
7540 &match, &match_len, &anchored,
7541 err, sizeof(err)));
7542 AGENT_TEST_ASSERT(strstr(err, "not found") != NULL);
7543 err[0] = '\0';
7544 AGENT_TEST_ASSERT(agent_edit_find_old_span(data, strlen(data), old, true,
7545 &match, &match_len, &anchored,
7546 err, sizeof(err)));
7547 AGENT_TEST_ASSERT(anchored);
7548 AGENT_TEST_ASSERT(match == data);
7549 AGENT_TEST_ASSERT(match_len == strlen(data) - strlen("\trm -f bc\n"));
7550}
7551
7552static void test_agent_edit_upto_requires_tail_after_newline_strip(void) {

Callers 2

worker_run_turnFunction · 0.85

Calls 7

ds4_session_evalFunction · 0.85
ds4_tokens_pushFunction · 0.85
ds4_token_textFunction · 0.85
agent_trace_tokenFunction · 0.85
agent_stream_textFunction · 0.85
agent_wake_lockedFunction · 0.85
now_secFunction · 0.70

Tested by

no test coverage detected