(
filePath: string,
source: string,
lang: Language,
minNodes = 3
)
| 82 | }); |
| 83 | |
| 84 | function assertParity( |
| 85 | filePath: string, |
| 86 | source: string, |
| 87 | lang: Language, |
| 88 | minNodes = 3 |
| 89 | ): ExtractionResult { |
| 90 | process.env.CODEGRAPH_KERNEL_LANGS = 'all'; |
| 91 | delete process.env.CODEGRAPH_KERNEL; |
| 92 | const viaKernel = tryKernelExtract(filePath, source, lang); |
| 93 | expect(viaKernel, `kernel extraction failed for ${filePath}`).not.toBeNull(); |
| 94 | |
| 95 | process.env.CODEGRAPH_KERNEL = '0'; |
| 96 | const viaWasm = extractFromSource(filePath, source, lang); |
| 97 | delete process.env.CODEGRAPH_KERNEL; |
| 98 | |
| 99 | const k = canon(viaKernel!); |
| 100 | const w = canon(viaWasm); |
| 101 | expect(k.nodes, `${filePath}: nodes`).toEqual(w.nodes); |
| 102 | expect(k.edges, `${filePath}: edges`).toEqual(w.edges); |
| 103 | expect(k.refs, `${filePath}: refs`).toEqual(w.refs); |
| 104 | expect(viaWasm.nodes.length).toBeGreaterThanOrEqual(minNodes); |
| 105 | return viaKernel!; |
| 106 | } |
| 107 | |
| 108 | it('torture.lua: requires, receiver QNs, visibility inversion, callee zoo, fn-refs', () => { |
| 109 | const file = path.join(FIXTURE_DIR, 'torture.lua'); |
no test coverage detected