(filePath: string, source: string, minNodes = 3)
| 85 | }); |
| 86 | |
| 87 | function assertParity(filePath: string, source: string, minNodes = 3): void { |
| 88 | process.env.CODEGRAPH_KERNEL_LANGS = 'all'; |
| 89 | delete process.env.CODEGRAPH_KERNEL; |
| 90 | const viaKernel = tryKernelExtract(filePath, source, 'php'); |
| 91 | expect(viaKernel, `kernel extraction failed for ${filePath}`).not.toBeNull(); |
| 92 | |
| 93 | process.env.CODEGRAPH_KERNEL = '0'; |
| 94 | const viaWasm = extractFromSource(filePath, source, 'php'); |
| 95 | delete process.env.CODEGRAPH_KERNEL; |
| 96 | |
| 97 | const k = canon(viaKernel!); |
| 98 | const w = canon(viaWasm); |
| 99 | expect(k.nodes, `${filePath}: nodes`).toEqual(w.nodes); |
| 100 | expect(k.edges, `${filePath}: edges`).toEqual(w.edges); |
| 101 | expect(k.refs, `${filePath}: refs`).toEqual(w.refs); |
| 102 | expect(viaWasm.nodes.length).toBeGreaterThanOrEqual(minNodes); |
| 103 | } |
| 104 | |
| 105 | const FIXTURES: Array<{ file: string; minNodes: number }> = [ |
| 106 | { file: 'torture.php', minNodes: 45 }, |
no test coverage detected