MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cx_order_first_diff

Function cx_order_first_diff

tests/test_pipeline.c:3296–3312  ·  view source on GitHub ↗

First line of `got` that differs from `want`, copied into out (for the * failure diagnostic). Returns false when the strings are identical. */

Source from the content-addressed store, hash-verified

3294/* First line of `got` that differs from `want`, copied into out (for the
3295 * failure diagnostic). Returns false when the strings are identical. */
3296static bool cx_order_first_diff(const char *want, const char *got, char *out, size_t cap) {
3297 if (strcmp(want, got) == 0) {
3298 return false;
3299 }
3300 while (*want && *got) {
3301 size_t lw = strcspn(want, "\n");
3302 size_t lg = strcspn(got, "\n");
3303 if (lw != lg || memcmp(want, got, lw) != 0) {
3304 snprintf(out, cap, "want '%.*s' got '%.*s'", (int)lw, want, (int)lg, got);
3305 return true;
3306 }
3307 want += lw + (want[lw] == '\n');
3308 got += lg + (got[lg] == '\n');
3309 }
3310 snprintf(out, cap, "line count differs");
3311 return true;
3312}
3313
3314TEST(pipeline_complexity_props_independent_of_worker_order) {
3315 char tmp[256];

Callers 1

test_pipeline.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected