(filePath: string, source: string, minNodes = 3)
| 73 | }); |
| 74 | |
| 75 | function assertParity(filePath: string, source: string, minNodes = 3): void { |
| 76 | process.env.CODEGRAPH_KERNEL_LANGS = 'all'; |
| 77 | delete process.env.CODEGRAPH_KERNEL; |
| 78 | const viaKernel = tryKernelExtract(filePath, source, 'rust'); |
| 79 | expect(viaKernel, `kernel extraction failed for ${filePath}`).not.toBeNull(); |
| 80 | |
| 81 | process.env.CODEGRAPH_KERNEL = '0'; |
| 82 | const viaWasm = extractFromSource(filePath, source, 'rust'); |
| 83 | delete process.env.CODEGRAPH_KERNEL; |
| 84 | |
| 85 | const k = canon(viaKernel!); |
| 86 | const w = canon(viaWasm); |
| 87 | expect(k.nodes, `${filePath}: nodes`).toEqual(w.nodes); |
| 88 | expect(k.edges, `${filePath}: edges`).toEqual(w.edges); |
| 89 | expect(k.refs, `${filePath}: refs`).toEqual(w.refs); |
| 90 | expect(viaWasm.nodes.length).toBeGreaterThanOrEqual(minNodes); |
| 91 | } |
| 92 | |
| 93 | it('torture fixture: impl/trait quirks, use bindings, chains, fn-refs, value-refs, route macros', () => { |
| 94 | const file = path.join(FIXTURE_DIR, 'torture.rs'); |
no test coverage detected