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

Function dg_write_all

tests/test_diagrams.c:1025–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1023}
1024
1025static void dg_write_all(const char *repo, int round) {
1026 char text[1024];
1027 snprintf(text, sizeof(text),
1028 "# Arch%s\n\n```mermaid\nflowchart LR\n A[Api] --> B[Db%d]\n"
1029 " click A \"../src/api.py\"\n```\n",
1030 round == 2 ? "itecture" : "", round);
1031 th_write_file(TH_PATH(repo, "docs/arch.md"), text);
1032 snprintf(text, sizeof(text),
1033 "@startuml\nclass Api [[../src/api.py]]\nclass Db\nApi --> Db : r%d\n"
1034 "@enduml\n",
1035 round);
1036 th_write_file(TH_PATH(repo, "diagrams/m.puml"), text);
1037 snprintf(text, sizeof(text), "digraph { a -> b [label=\"r%d\"]; }\n", round);
1038 th_write_file(TH_PATH(repo, "diagrams/g.dot"), text);
1039 snprintf(text, sizeof(text), "x: X\ny: Y%d\nx -> y\n", round);
1040 th_write_file(TH_PATH(repo, "diagrams/s.d2"), text);
1041 snprintf(text, sizeof(text),
1042 "<mxfile><diagram name=\"P\"><mxGraphModel><root>"
1043 "<mxCell id=\"2\" value=\"One\" vertex=\"1\"/><mxCell id=\"3\" value=\"Two%d\" "
1044 "vertex=\"1\"/><mxCell id=\"4\" edge=\"1\" source=\"2\" target=\"3\"/>"
1045 "</root></mxGraphModel></diagram></mxfile>",
1046 round);
1047 th_write_file(TH_PATH(repo, "diagrams/p.drawio"), text);
1048 snprintf(text, sizeof(text),
1049 "Guide\n=====\n\n.. mermaid::\n\n flowchart LR\n G --> H%d\n", round);
1050 th_write_file(TH_PATH(repo, "docs/guide.rst"), text);
1051 snprintf(text, sizeof(text), "= Guide\n\n== Flow\n\n[plantuml]\n----\n[P] --> [Q%d]\n----\n",
1052 round);
1053 th_write_file(TH_PATH(repo, "docs/flow.adoc"), text);
1054 if (round < 2) {
1055 snprintf(text, sizeof(text),
1056 "{\"type\":\"excalidraw\",\"elements\":["
1057 "{\"id\":\"r1\",\"type\":\"rectangle\"},{\"id\":\"t1\",\"type\":\"text\","
1058 "\"text\":\"U%d\",\"containerId\":\"r1\"},{\"id\":\"r2\",\"type\":\"rectangle\"},"
1059 "{\"id\":\"t2\",\"type\":\"text\",\"text\":\"V\",\"containerId\":\"r2\"},"
1060 "{\"id\":\"a\",\"type\":\"arrow\",\"startBinding\":{\"elementId\":\"r1\"},"
1061 "\"endBinding\":{\"elementId\":\"r2\"}}]}",
1062 round);
1063 th_write_file(TH_PATH(repo, "diagrams/e.excalidraw"), text);
1064 }
1065}
1066
1067TEST(diagrams_incremental_equals_full) {
1068 dm_ship_held_families();

Callers 1

test_diagrams.cFile · 0.85

Calls 1

th_write_fileFunction · 0.85

Tested by

no test coverage detected