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

Function buildRustWorkspace

__tests__/symbol-lookup.test.ts:48–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48async function buildRustWorkspace(): Promise<string> {
49 const root = tmpRoot();
50 const cfgDir = path.join(root, 'src', 'configurator');
51 fs.mkdirSync(cfgDir, { recursive: true });
52 fs.writeFileSync(
53 path.join(root, 'Cargo.toml'),
54 `[package]\nname = "fixture"\nversion = "0.1.0"\nedition = "2021"\n[lib]\npath = "src/lib.rs"\n`
55 );
56 fs.writeFileSync(path.join(root, 'src', 'lib.rs'), `pub mod configurator;\npub mod scheduler;\n`);
57 fs.writeFileSync(
58 path.join(cfgDir, 'mod.rs'),
59 `pub mod stage_apply;\npub mod stage_detect;\n`
60 );
61 fs.writeFileSync(
62 path.join(cfgDir, 'stage_apply.rs'),
63 `pub async fn run() -> Result<(), ()> {\n render_and_write();\n Ok(())\n}\n\nfn render_and_write() {}\n`
64 );
65 fs.writeFileSync(
66 path.join(cfgDir, 'stage_detect.rs'),
67 `pub async fn run() -> Result<(), ()> { Ok(()) }\n`
68 );
69 fs.writeFileSync(
70 path.join(root, 'src', 'scheduler.rs'),
71 `pub fn run_due_tasks() -> Result<(), ()> { Ok(()) }\n`
72 );
73 return root;
74}
75
76describe.skipIf(!HAS_SQLITE)('matchesSymbol — module-qualified lookups (#173)', () => {
77 let projectRoot: string;

Callers 1

Calls 2

tmpRootFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected