Get tests passing without engine connection (#155)
We can create a enginelessExecutor that can be used for many of the executor tests that will be much more performant for tests that don't need the engine to actually do any modeling work.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { abstractSyntaxTree } from '../abstractSyntaxTree'
|
||||
import { executor } from '../../lib/testHelpers'
|
||||
import { enginelessExecutor } from '../../lib/testHelpers'
|
||||
import { lexer } from '../tokeniser'
|
||||
import { initPromise } from '../rust'
|
||||
|
||||
@ -18,9 +18,11 @@ describe('testing angledLineThatIntersects', () => {
|
||||
}, %)
|
||||
const intersect = segEndX('yo2', part001)
|
||||
show(part001)`
|
||||
const { root } = await executor(abstractSyntaxTree(lexer(code('-1'))))
|
||||
const { root } = await enginelessExecutor(
|
||||
abstractSyntaxTree(lexer(code('-1')))
|
||||
)
|
||||
expect(root.intersect.value).toBe(1 + Math.sqrt(2))
|
||||
const { root: noOffset } = await executor(
|
||||
const { root: noOffset } = await enginelessExecutor(
|
||||
abstractSyntaxTree(lexer(code('0')))
|
||||
)
|
||||
expect(noOffset.intersect.value).toBeCloseTo(1)
|
||||
|
Reference in New Issue
Block a user