MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / write

Function write

__tests__/cpp-base-class-lookup.test.ts:524–527  ·  view source on GitHub ↗
(rel: string, lines: string[])

Source from the content-addressed store, hash-verified

522 beforeAll(async () => {
523 root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-cpp-alias-twins-'));
524 const write = (rel: string, lines: string[]) => {
525 fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
526 fs.writeFileSync(path.join(root, rel), lines.join('\n') + '\n');
527 };
528 write('B/config_b.h', ['#pragma once', 'namespace n {', 'class FastStore { public: void flush() {} };', '#ifdef USE_FAST', 'typedef FastStore Store;', '#endif', '}']);
529 write('a/config_a.h', ['#pragma once', 'namespace n {', 'class SafeStore { public: void flush() {} };', '#ifndef USE_FAST', 'typedef SafeStore Store;', '#endif', '}']);
530 write('main.cpp', ['#include "B/config_b.h"', '#include "a/config_a.h"', 'namespace n {', 'class Derived : public Store {};', '}']);

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected