(rel: string, lines: string[])
| 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 {};', '}']); |
no test coverage detected