Declare parts of std in KCL rather than Rust (#5147)

Declare std in KCL
This commit is contained in:
Nick Cameron
2025-02-20 19:33:21 +13:00
committed by GitHub
parent 099c48cd63
commit 7500ef0065
205 changed files with 17053 additions and 1503 deletions

View File

@ -33,49 +33,45 @@ describe('processMemory', () => {
const output = processMemory(execState.variables)
expect(output.myVar).toEqual(5)
expect(output.otherVar).toEqual(3)
expect(output).toEqual({
myVar: 5,
myFn: '__function(a)__',
otherVar: 3,
theExtrude: [
{
type: 'extrudePlane',
tag: null,
id: expect.any(String),
faceId: expect.any(String),
sourceRange: [expect.any(Number), expect.any(Number), 0],
},
{
type: 'extrudePlane',
tag: null,
id: expect.any(String),
faceId: expect.any(String),
sourceRange: [expect.any(Number), expect.any(Number), 0],
},
],
theSketch: [
{
type: 'ToPoint',
to: [-3.35, 0.17],
from: [0, 0],
units: { type: 'Mm' },
tag: null,
},
{
type: 'ToPoint',
to: [0.98, 5.16],
from: [-3.35, 0.17],
units: { type: 'Mm' },
tag: null,
},
{
type: 'ToPoint',
to: [2.15, 4.32],
from: [0.98, 5.16],
units: { type: 'Mm' },
tag: null,
},
],
})
expect(output.myFn).toEqual('__function(a)__')
expect(output.theExtrude).toEqual([
{
type: 'extrudePlane',
tag: null,
id: expect.any(String),
faceId: expect.any(String),
sourceRange: [expect.any(Number), expect.any(Number), 0],
},
{
type: 'extrudePlane',
tag: null,
id: expect.any(String),
faceId: expect.any(String),
sourceRange: [expect.any(Number), expect.any(Number), 0],
},
])
expect(output.theSketch).toEqual([
{
type: 'ToPoint',
to: [-3.35, 0.17],
from: [0, 0],
units: { type: 'Mm' },
tag: null,
},
{
type: 'ToPoint',
to: [0.98, 5.16],
from: [-3.35, 0.17],
units: { type: 'Mm' },
tag: null,
},
{
type: 'ToPoint',
to: [2.15, 4.32],
from: [0.98, 5.16],
units: { type: 'Mm' },
tag: null,
},
])
})
})