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

Function markup_robustness

tests/repro/repro_grammar_markup.c:422–436  ·  view source on GitHub ↗

-- Robustness helper: assert call RETURNS on malformed input -------------- * * A truncated version of the fixture is passed through cbm_extract_file. * has_error may be set (1) but the call must return non-NULL. If it returns NULL * the extractor crashed or aborted on bad input -- that is a RED robustness bug. * Returns 0 on PASS, 1 on FAIL. */

Source from the content-addressed store, hash-verified

420 * Returns 0 on PASS, 1 on FAIL.
421 */
422static int markup_robustness(const char *lang_tag, const char *bad_src,
423 CBMLanguage lang, const char *file) {
424 const char *RED = tf_red();
425 const char *RST = tf_reset();
426
427 CBMFileResult *r = cbm_extract_file(bad_src, (int)strlen(bad_src),
428 lang, "t", file, 0, NULL, NULL);
429 if (!r) {
430 printf(" %sFAIL%s [%s] robustness: extractor returned NULL on malformed input\n",
431 RED, RST, lang_tag);
432 return 1;
433 }
434 cbm_free_result(r);
435 return 0;
436}
437
438/* -- MARKDOWN ----------------------------------------------------------------
439 * Idiomatic Markdown document with ATX headings (# / ##) and a setext heading

Callers 1

Calls 4

tf_redFunction · 0.85
tf_resetFunction · 0.85
cbm_extract_fileFunction · 0.85
cbm_free_resultFunction · 0.85

Tested by

no test coverage detected