Compare commits
22 Commits
jtran/unit
...
kcl-54
Author | SHA1 | Date | |
---|---|---|---|
e4edffa569 | |||
c28bad267a | |||
81f92bc7f9 | |||
58dc3382eb | |||
f7f7d9fa2c | |||
8c3408fda3 | |||
7c9f1248d4 | |||
89dd4fb039 | |||
fdeb2b3f49 | |||
65c455ae7c | |||
c3e12e5ff7 | |||
4dce1612c1 | |||
1b98897120 | |||
3b2abe5814 | |||
dddcd5ff46 | |||
cfbb03765e | |||
0d0dd1019b | |||
de2b1b3bea | |||
3464f93a30 | |||
f6936f55d6 | |||
eef1a28ebb | |||
5aed80e930 |
16
.github/workflows/e2e-tests.yml
vendored
@ -1,7 +1,9 @@
|
||||
name: E2E Tests
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- main
|
||||
- all-e2e # this bypasses `fixme()` using `orRunWhenFullSuiteEnabled()`
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: 0 * * * * # hourly
|
||||
@ -15,7 +17,6 @@ permissions:
|
||||
pull-requests: write
|
||||
actions: read
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
conditions:
|
||||
@ -67,14 +68,16 @@ jobs:
|
||||
- name: Display conditions
|
||||
shell: bash
|
||||
run: |
|
||||
# For debugging purposes.
|
||||
# For debugging purposes
|
||||
set -euo pipefail
|
||||
echo "GITHUB_REF: $GITHUB_REF"
|
||||
echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF"
|
||||
echo "GITHUB_BASE_REF: $GITHUB_BASE_REF"
|
||||
echo "significant: ${{ steps.path-changes.outputs.significant }}"
|
||||
echo "should-run: ${{ steps.should-run.outputs.should-run }}"
|
||||
|
||||
|
||||
prepare-wasm:
|
||||
# seperate job on Ubuntu to build or fetch the wasm blob once on the fastest runner
|
||||
# separate job on Ubuntu to build or fetch the wasm blob once on the fastest runner
|
||||
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||
needs: conditions
|
||||
steps:
|
||||
@ -159,7 +162,6 @@ jobs:
|
||||
name: prepared-wasm
|
||||
path: |
|
||||
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||
|
||||
|
||||
snapshots:
|
||||
name: playwright:snapshots:ubuntu
|
||||
@ -243,7 +245,7 @@ jobs:
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
- name: check for changes
|
||||
- name: Check for changes
|
||||
if: ${{ needs.conditions.outputs.should-run == 'true' && github.ref != 'refs/heads/main' }}
|
||||
shell: bash
|
||||
id: git-check
|
||||
|
4
.github/workflows/static-analysis.yml
vendored
@ -141,13 +141,13 @@ jobs:
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: yarn playwright install chromium --with-deps
|
||||
|
||||
- name: run unit tests
|
||||
- name: Run unit tests
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: xvfb-run -a yarn test:unit
|
||||
env:
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
||||
- name: check for changes
|
||||
- name: Check for changes
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
id: git-check
|
||||
run: |
|
||||
|
14
.github/workflows/update-e2e-branch.yml
vendored
@ -14,10 +14,19 @@ permissions:
|
||||
jobs:
|
||||
update-branch:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- shell: bash
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
- name: Sync with main
|
||||
run: |
|
||||
# checkout our branch
|
||||
git checkout all-e2e || git checkout -b all-e2e
|
||||
@ -26,4 +35,5 @@ jobs:
|
||||
# reset to main
|
||||
git reset --hard origin/main
|
||||
# force push it
|
||||
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}.git
|
||||
git push --force origin all-e2e
|
||||
|
32
Makefile
@ -20,8 +20,12 @@ $(WASM_PACK):
|
||||
###############################################################################
|
||||
# BUILD
|
||||
|
||||
RUST_SOURCES := $(wildcard rust/*) $(wildcard rust/**/*)
|
||||
TYPESCRIPT_SOURCES := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
||||
CARGO_SOURCES := rust/.cargo/config.toml $(wildcard rust/Cargo.*) $(wildcard rust/**/Cargo.*)
|
||||
RUST_SOURCES := $(wildcard rust/**/*.rs)
|
||||
|
||||
REACT_SOURCES := $(wildcard src/*.tsx) $(wildcard src/**/*.tsx)
|
||||
TYPESCRIPT_SOURCES := tsconfig.* $(wildcard src/*.ts) $(wildcard src/**/*.ts)
|
||||
VITE_SOURCES := $(wildcard vite.*) $(wildcard vite/**/*.tsx)
|
||||
|
||||
.PHONY: build
|
||||
build: build-web build-desktop
|
||||
@ -32,13 +36,13 @@ build-web: public/kcl_wasm_lib_bg.wasm build/index.html
|
||||
.PHONY: build-desktop
|
||||
build-desktop: public/kcl_wasm_lib_bg.wasm .vite/build/main.js
|
||||
|
||||
public/kcl_wasm_lib_bg.wasm: $(RUST_SOURCES)
|
||||
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES)$(RUST_SOURCES)
|
||||
yarn build:wasm
|
||||
|
||||
build/index.html: $(TYPESCRIPT_SOURCES)
|
||||
build/index.html: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
||||
yarn build:local
|
||||
|
||||
.vite/build/main.js: $(TYPESCRIPT_SOURCES)
|
||||
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
||||
yarn tronb:vite:dev
|
||||
|
||||
###############################################################################
|
||||
@ -73,19 +77,29 @@ run-desktop: install build-desktop ## Start the desktop app
|
||||
###############################################################################
|
||||
# TEST
|
||||
|
||||
GREP ?= ""
|
||||
E2E_WORKERS ?= 1
|
||||
E2E_FAILURES ?= 1
|
||||
E2E_GREP ?= ""
|
||||
|
||||
.PHONY: test
|
||||
test: test-unit test-e2e
|
||||
|
||||
.PHONY: test-unit
|
||||
test-unit: install ## Run the unit tests
|
||||
@ nc -z localhost 3000 || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||
yarn test:unit
|
||||
|
||||
.PHONY: test-e2e
|
||||
test-e2e: install build-desktop ## Run the e2e tests
|
||||
yarn test:playwright:electron --workers=1 --grep=$(GREP)
|
||||
test-e2e: test-e2e-desktop
|
||||
|
||||
.PHONY: test-e2e-web
|
||||
test-e2e-web: install build-web ## Run the web e2e tests
|
||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||
yarn chrome:test --headed --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep=$(E2E_GREP)
|
||||
|
||||
.PHONY: test-e2e-desktop
|
||||
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests
|
||||
yarn test:playwright:electron --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep=$(E2E_GREP)
|
||||
|
||||
###############################################################################
|
||||
# CLEAN
|
||||
|
@ -10,10 +10,10 @@ Construct a circle derived from 3 points.
|
||||
|
||||
```js
|
||||
circleThreePoint(
|
||||
sketchSurfaceOrGroup: SketchOrSurface,
|
||||
p1: [number],
|
||||
p2: [number],
|
||||
p3: [number],
|
||||
sketchSurfaceOrGroup: SketchOrSurface,
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
```
|
||||
@ -23,10 +23,10 @@ circleThreePoint(
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
||||
| `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes |
|
||||
| `p2` | [`[number]`](/docs/kcl/types/number) | 2nd point to derive the circle. | Yes |
|
||||
| `p3` | [`[number]`](/docs/kcl/types/number) | 3rd point to derive the circle. | Yes |
|
||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
||||
|
||||
### Returns
|
||||
|
@ -15,7 +15,7 @@ std::math::E: number = 2.71828182845904523536028747135266250_
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn("XZ")
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({
|
||||
angle = 30,
|
||||
|
@ -17,7 +17,7 @@ std::math::PI: number = 3.14159265358979323846264338327950288_
|
||||
```js
|
||||
circumference = 70
|
||||
|
||||
exampleSketch = startSketchOn("XZ")
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = circumference/ (2 * PI))
|
||||
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
|
@ -15,7 +15,7 @@ std::math::TAU: number = 6.28318530717958647692528676655900577_
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn("XZ")
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({
|
||||
angle = 50,
|
||||
|
@ -61,7 +61,6 @@ layout: manual
|
||||
* [`bezierCurve`](kcl/bezierCurve)
|
||||
* [`ceil`](kcl/ceil)
|
||||
* [`chamfer`](kcl/chamfer)
|
||||
* [`circle`](kcl/circle)
|
||||
* [`circleThreePoint`](kcl/circleThreePoint)
|
||||
* [`close`](kcl/close)
|
||||
* [`cm`](kcl/cm)
|
||||
@ -74,7 +73,6 @@ layout: manual
|
||||
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
||||
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
||||
* [`helix`](kcl/helix)
|
||||
* [`helixRevolutions`](kcl/helixRevolutions)
|
||||
* [`hole`](kcl/hole)
|
||||
* [`hollow`](kcl/hollow)
|
||||
* [`inch`](kcl/inch)
|
||||
@ -146,3 +144,5 @@ layout: manual
|
||||
* [`cos`](kcl/std-math-cos)
|
||||
* [`sin`](kcl/std-math-sin)
|
||||
* [`tan`](kcl/std-math-tan)
|
||||
* **std::sketch**
|
||||
* [`circle`](kcl/std-sketch-circle)
|
||||
|
@ -9,7 +9,7 @@ Compute the cosine of a number (in radians).
|
||||
|
||||
|
||||
```js
|
||||
cos(num: number(rad)): number(_)
|
||||
cos(@num: number(rad)): number(_)
|
||||
```
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ cos(num: number(rad)): number(_)
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn("XZ")
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({
|
||||
angle = 30,
|
||||
|
@ -9,7 +9,7 @@ Compute the sine of a number (in radians).
|
||||
|
||||
|
||||
```js
|
||||
sin(num: number(rad)): number(_)
|
||||
sin(@num: number(rad)): number(_)
|
||||
```
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ sin(num: number(rad)): number(_)
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn("XZ")
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({
|
||||
angle = 50,
|
||||
|
@ -9,7 +9,7 @@ Compute the tangent of a number (in radians).
|
||||
|
||||
|
||||
```js
|
||||
tan(num: number(rad)): number(_)
|
||||
tan(@num: number(rad)): number(_)
|
||||
```
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ tan(num: number(rad)): number(_)
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn("XZ")
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine({
|
||||
angle = 50,
|
||||
|
55
docs/kcl/std-sketch-circle.md
Normal file
15302
docs/kcl/std.json
@ -21,6 +21,7 @@ A helix.
|
||||
| `revolutions` |[`number`](/docs/kcl/types/number)| Number of revolutions. | No |
|
||||
| `angleStart` |[`number`](/docs/kcl/types/number)| Start angle (in degrees). | No |
|
||||
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
|
||||
| `cylinderId` |[`string`](/docs/kcl/types/string)| The cylinder the helix was created on. | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||
|
||||
|
||||
|
@ -10,8 +10,8 @@ A point in two dimensional space.
|
||||
type Point2d = [number; 2]
|
||||
```
|
||||
|
||||
`Point2d` is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value
|
||||
with type `Point2d`, use an array, e.g., `[0, 0]` or `[5.0, 3.14]`.
|
||||
[`Point2d`](/docs/kcl/types/Point2d) is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value
|
||||
with type [`Point2d`](/docs/kcl/types/Point2d), use an array, e.g., `[0, 0]` or `[5.0, 3.14]`.
|
||||
|
||||
|
||||
|
||||
|
@ -10,8 +10,8 @@ A point in three dimensional space.
|
||||
type Point3d = [number; 3]
|
||||
```
|
||||
|
||||
`Point3d` is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value
|
||||
with type `Point3d`, use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`.
|
||||
[`Point3d`](/docs/kcl/types/Point3d) is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value
|
||||
with type [`Point3d`](/docs/kcl/types/Point3d), use an array, e.g., `[0, 0, 0]` or `[5.0, 3.14, 6.8]`.
|
||||
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@ mySketch = startSketchOn('XY')
|
||||
|> close()
|
||||
```
|
||||
|
||||
The `mySketch` variable will be an executed `Sketch` object. Executed being past
|
||||
The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/Sketch) object. Executed being past
|
||||
tense, because the engine has already executed the commands to create the sketch.
|
||||
|
||||
The previous sketch commands will never be executed again, in this case.
|
||||
|
@ -18,7 +18,7 @@ myPart = startSketchOn('XY')
|
||||
|> extrude(length = 6)
|
||||
```
|
||||
|
||||
The `myPart` variable will be an executed `Solid` object. Executed being past
|
||||
The `myPart` variable will be an executed [`Solid`](/docs/kcl/types/Solid) object. Executed being past
|
||||
tense, because the engine has already executed the commands to create the solid.
|
||||
|
||||
The previous solid commands will never be executed again, in this case.
|
||||
|
@ -85,7 +85,7 @@ async function doBasicSketch(
|
||||
await page.mouse.click(startXPx, 500 - PUR * 20)
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
commonPoints.startAt
|
||||
}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1})
|
||||
@ -145,7 +145,7 @@ async function doBasicSketch(
|
||||
// Open the code pane.
|
||||
await u.openKclCodePanel()
|
||||
await expect(u.codeLocator)
|
||||
.toHaveText(`@settings(defaultLengthUnit = in)sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)profile001 = startProfileAt(${
|
||||
commonPoints.startAt
|
||||
}, sketch001)
|
||||
|> xLine(length = ${commonPoints.num1}, tag = $seg01)
|
||||
|
@ -46,7 +46,7 @@ test.describe(
|
||||
},
|
||||
}
|
||||
|
||||
const code = `@settings(defaultLengthUnit = in)sketch001 = startSketchOn('${plane}')profile001 = startProfileAt([0.91, -1.22], sketch001)`
|
||||
const code = `sketch001 = startSketchOn(${plane})profile001 = startProfileAt([0.91, -1.22], sketch001)`
|
||||
|
||||
await u.openDebugPanel()
|
||||
|
||||
|
@ -250,11 +250,11 @@ test(
|
||||
])
|
||||
await Promise.all([
|
||||
fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('router-template-slate.kcl'),
|
||||
join(routerTemplateDir, 'main.kcl')
|
||||
),
|
||||
fsp.copyFile(
|
||||
executorInputPath('e2e-can-sketch-on-chamfer.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
join(bracketDir, 'main.kcl')
|
||||
),
|
||||
])
|
||||
|
@ -20,11 +20,11 @@ test(
|
||||
await Promise.all([fsp.mkdir(bracketDir, { recursive: true })])
|
||||
await Promise.all([
|
||||
fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('router-template-slate.kcl'),
|
||||
path.join(bracketDir, 'other.kcl')
|
||||
),
|
||||
fsp.copyFile(
|
||||
executorInputPath('e2e-can-sketch-on-chamfer.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
),
|
||||
])
|
||||
@ -107,7 +107,7 @@ test(
|
||||
},
|
||||
{ timeout: 15_000 }
|
||||
)
|
||||
.toBeGreaterThan(30_000)
|
||||
.toBeGreaterThan(300_000)
|
||||
})
|
||||
})
|
||||
|
||||
@ -187,7 +187,7 @@ test(
|
||||
},
|
||||
{ timeout: 15_000 }
|
||||
)
|
||||
.toBeGreaterThan(50_000)
|
||||
.toBeGreaterThan(70_000)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -32,30 +32,26 @@ test.describe('Editor tests', { tag: ['@skipWin'] }, () => {
|
||||
await page.keyboard.press('/')
|
||||
await page.keyboard.up('ControlOrMeta')
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn('XY')
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
// |> close()`.replaceAll('\n', '')
|
||||
)
|
||||
// |> close()`)
|
||||
|
||||
// uncomment the code
|
||||
await page.keyboard.down('ControlOrMeta')
|
||||
await page.keyboard.press('/')
|
||||
await page.keyboard.up('ControlOrMeta')
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn('XY')
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close()`.replaceAll('\n', '')
|
||||
)
|
||||
|> close()`)
|
||||
})
|
||||
|
||||
test('ensure we use the cache, and do not re-execute', async ({
|
||||
@ -182,15 +178,13 @@ sketch001 = startSketchOn('XY')
|
||||
await page.locator('#code-pane button:first-child').click()
|
||||
await page.locator('button:has-text("Format code")').click()
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn('XY')
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close()`.replaceAll('\n', '')
|
||||
)
|
||||
|> close()`)
|
||||
})
|
||||
|
||||
test('if you click the format button it formats your code and executes so lints are still there', async ({
|
||||
@ -233,15 +227,13 @@ sketch001 = startSketchOn('XY')
|
||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
||||
await u.closeDebugPanel()
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch_001 = startSketchOn('XY')
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch_001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close()`.replaceAll('\n', '')
|
||||
)
|
||||
|> close()`)
|
||||
|
||||
// error in guter
|
||||
await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible()
|
||||
@ -823,12 +815,10 @@ sketch_001 = startSketchOn('XY')
|
||||
// there shouldn't be any auto complete options for 'lin' in the comment
|
||||
await expect(page.locator('.cm-completionLabel')).not.toBeVisible()
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn('XZ')
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([3.14, 12], %)
|
||||
|> xLine(%, length = 5) // lin`.replaceAll('\n', '')
|
||||
)
|
||||
|> xLine(%, length = 5) // lin`)
|
||||
|
||||
// expect there to be no KCL errors
|
||||
await expect(page.locator('.cm-lint-marker-error')).toHaveCount(0)
|
||||
@ -898,12 +888,10 @@ sketch001 = startSketchOn('XZ')
|
||||
// there shouldn't be any auto complete options for 'lin' in the comment
|
||||
await expect(page.locator('.cm-completionLabel')).not.toBeVisible()
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn('XZ')
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([3.14, 12], %)
|
||||
|> xLine(%, length = 5) // lin`.replaceAll('\n', '')
|
||||
)
|
||||
|> xLine(%, length = 5) // lin`)
|
||||
})
|
||||
})
|
||||
test('Can undo a click and point extrude with ctrl+z', async ({
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
executorInputPath,
|
||||
getUtils,
|
||||
orRunWhenFullSuiteEnabled,
|
||||
runningOnWindows,
|
||||
} from './test-utils'
|
||||
import { join } from 'path'
|
||||
import { FILE_EXT } from 'lib/constants'
|
||||
@ -15,6 +16,9 @@ test.describe('integrations tests', () => {
|
||||
'Creating a new file or switching file while in sketchMode should exit sketchMode',
|
||||
{ tag: '@electron' },
|
||||
async ({ page, context, homePage, scene, editor, toolbar, cmdBar }) => {
|
||||
if (runningOnWindows()) {
|
||||
test.fixme(orRunWhenFullSuiteEnabled())
|
||||
}
|
||||
await context.folderSetupFn(async (dir) => {
|
||||
const bracketDir = join(dir, 'test-sample')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
|
@ -310,9 +310,7 @@ export async function expectPixelColor(
|
||||
.toBeTruthy()
|
||||
.catch((cause) => {
|
||||
throw new Error(
|
||||
`ExpectPixelColor: point ${JSON.stringify(
|
||||
coords
|
||||
)} was expecting ${colour} but got ${finalValue}`,
|
||||
`ExpectPixelColor: expecting ${colour} got ${finalValue}`,
|
||||
{ cause }
|
||||
)
|
||||
})
|
||||
|
@ -11,7 +11,7 @@ test(
|
||||
const bracketDir = join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
@ -51,7 +51,7 @@ test(
|
||||
const bracketDir = join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
|
@ -137,7 +137,7 @@ test.describe('Point-and-click tests', () => {
|
||||
|
||||
await scene.moveCameraTo(cameraPos, cameraTarget)
|
||||
|
||||
await test.step('check chamfer selection changes cursor position', async () => {
|
||||
await test.step('check chamfer selection changes cursor positon', async () => {
|
||||
await expect(async () => {
|
||||
// sometimes initial click doesn't register
|
||||
await clickChamfer()
|
||||
@ -173,7 +173,7 @@ test.describe('Point-and-click tests', () => {
|
||||
})
|
||||
await test.step('Check there is no errors after code created in previous steps executes', async () => {
|
||||
await editor.expectState({
|
||||
activeLines: ['@settings(defaultLengthUnit = in)'],
|
||||
activeLines: ['sketch001 = startSketchOn(XZ)'],
|
||||
highlightedCode: '',
|
||||
diagnostics: [],
|
||||
})
|
||||
@ -299,8 +299,7 @@ test.describe('Point-and-click tests', () => {
|
||||
|
||||
await test.step('verify at the end of the test that final code is what is expected', async () => {
|
||||
await editor.expectEditor.toContain(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([75.8, 317.2], %) // [$startCapTag, $EndCapTag]
|
||||
|> angledLine([0, 268.43], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
@ -370,7 +369,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
|
||||
})
|
||||
})
|
||||
|
||||
test('Works on chamfers that are not in a pipeExpression can break up multi edges in a chamfer array', async ({
|
||||
test('Works on chamfers that are non in a pipeExpression can break up multi edges in a chamfer array', async ({
|
||||
context,
|
||||
page,
|
||||
homePage,
|
||||
@ -419,8 +418,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
|
||||
|>close()`,
|
||||
})
|
||||
await editor.expectEditor.toContain(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([75.8, 317.2], %)
|
||||
|> angledLine([0, 268.43], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
@ -1073,7 +1071,7 @@ openSketch = startSketchOn(XY)
|
||||
})
|
||||
})
|
||||
|
||||
test('Helix point-and-click', async ({
|
||||
test('Helix point-and-click on default axis', async ({
|
||||
context,
|
||||
page,
|
||||
homePage,
|
||||
@ -1084,29 +1082,26 @@ openSketch = startSketchOn(XY)
|
||||
}) => {
|
||||
// One dumb hardcoded screen pixel value
|
||||
const testPoint = { x: 620, y: 257 }
|
||||
const expectedOutput = `helix001 = helix( revolutions = 1, angleStart = 360, counterClockWise = false, radius = 5, axis = 'X', length = 5,)`
|
||||
const expectedOutput = `helix001 = helix( revolutions = 1, angleStart = 360, ccw = false, radius = 5, axis = 'X', length = 5,)`
|
||||
const expectedLine = `revolutions=1,`
|
||||
|
||||
await homePage.goToModelingScene()
|
||||
|
||||
// await test.step(`Look for the red of the default plane`, async () => {
|
||||
// await scene.expectPixelColor([96, 52, 52], testPoint, 15)
|
||||
// })
|
||||
await test.step(`Go through the command bar flow`, async () => {
|
||||
await toolbar.helixButton.click()
|
||||
await cmdBar.expectState({
|
||||
stage: 'arguments',
|
||||
currentArgKey: 'revolutions',
|
||||
currentArgValue: '1',
|
||||
currentArgKey: 'axisOrEdge',
|
||||
currentArgValue: '',
|
||||
headerArguments: {
|
||||
AngleStart: '',
|
||||
Axis: '',
|
||||
AxisOrEdge: '',
|
||||
CounterClockWise: '',
|
||||
Length: '',
|
||||
Radius: '',
|
||||
Revolutions: '',
|
||||
},
|
||||
highlightedHeaderArg: 'revolutions',
|
||||
highlightedHeaderArg: 'axisOrEdge',
|
||||
commandName: 'Helix',
|
||||
})
|
||||
await cmdBar.progressCmdBar()
|
||||
@ -1116,6 +1111,7 @@ openSketch = startSketchOn(XY)
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.progressCmdBar()
|
||||
})
|
||||
|
||||
await test.step(`Confirm code is added to the editor, scene has changed`, async () => {
|
||||
@ -1181,6 +1177,165 @@ openSketch = startSketchOn(XY)
|
||||
})
|
||||
})
|
||||
|
||||
const helixCases = [
|
||||
{
|
||||
selectionType: 'segment',
|
||||
testPoint: { x: 513, y: 221 },
|
||||
expectedOutput: `helix001 = helix( revolutions = 20, angleStart = 0, ccw = true, radius = 1, axis = seg01, length = 100,)`,
|
||||
expectedEditedOutput: `helix001 = helix( revolutions = 20, angleStart = 0, ccw = true, radius = 1, axis = seg01, length = 50,)`,
|
||||
},
|
||||
{
|
||||
selectionType: 'sweepEdge',
|
||||
testPoint: { x: 564, y: 364 },
|
||||
expectedOutput: `helix001 = helix( revolutions = 20, angleStart = 0, ccw = true, radius = 1, axis = getOppositeEdge(seg01), length = 100,)`,
|
||||
expectedEditedOutput: `helix001 = helix( revolutions = 20, angleStart = 0, ccw = true, radius = 1, axis = getOppositeEdge(seg01), length = 50,)`,
|
||||
},
|
||||
]
|
||||
helixCases.map(
|
||||
({ selectionType, testPoint, expectedOutput, expectedEditedOutput }) => {
|
||||
test(`Helix point-and-click around ${selectionType}`, async ({
|
||||
context,
|
||||
page,
|
||||
homePage,
|
||||
scene,
|
||||
editor,
|
||||
toolbar,
|
||||
cmdBar,
|
||||
}) => {
|
||||
page.on('console', console.log)
|
||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
||||
profile001 = startProfileAt([0, 0], sketch001)
|
||||
|> yLine(length = 100)
|
||||
|> line(endAbsolute = [100, 0])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
extrude001 = extrude(profile001, length = 100)`
|
||||
|
||||
// One dumb hardcoded screen pixel value
|
||||
const [clickOnEdge] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
|
||||
|
||||
await context.addInitScript((initialCode) => {
|
||||
localStorage.setItem('persistCode', initialCode)
|
||||
}, initialCode)
|
||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
||||
await homePage.goToModelingScene()
|
||||
|
||||
await test.step(`Go through the command bar flow`, async () => {
|
||||
await toolbar.closePane('code')
|
||||
await toolbar.helixButton.click()
|
||||
await cmdBar.expectState({
|
||||
stage: 'arguments',
|
||||
currentArgKey: 'axisOrEdge',
|
||||
currentArgValue: '',
|
||||
headerArguments: {
|
||||
AngleStart: '',
|
||||
AxisOrEdge: '',
|
||||
CounterClockWise: '',
|
||||
Length: '',
|
||||
Radius: '',
|
||||
Revolutions: '',
|
||||
},
|
||||
highlightedHeaderArg: 'axisOrEdge',
|
||||
commandName: 'Helix',
|
||||
})
|
||||
await cmdBar.selectOption({ name: 'Edge' }).click()
|
||||
await clickOnEdge()
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.argumentInput.focus()
|
||||
await page.keyboard.insertText('20')
|
||||
await cmdBar.progressCmdBar()
|
||||
await page.keyboard.insertText('0')
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.selectOption({ name: 'True' }).click()
|
||||
await page.keyboard.insertText('1')
|
||||
await cmdBar.progressCmdBar()
|
||||
await page.keyboard.insertText('100')
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.expectState({
|
||||
stage: 'review',
|
||||
headerArguments: {
|
||||
AngleStart: '0',
|
||||
AxisOrEdge: 'Edge',
|
||||
Edge: `1 ${selectionType}`,
|
||||
CounterClockWise: '',
|
||||
Length: '100',
|
||||
Radius: '1',
|
||||
Revolutions: '20',
|
||||
},
|
||||
commandName: 'Helix',
|
||||
})
|
||||
await cmdBar.progressCmdBar()
|
||||
})
|
||||
|
||||
await test.step(`Confirm code is added to the editor, scene has changed`, async () => {
|
||||
await toolbar.openPane('code')
|
||||
await editor.expectEditor.toContain(expectedOutput)
|
||||
await toolbar.closePane('code')
|
||||
})
|
||||
|
||||
await test.step(`Edit helix through the feature tree`, async () => {
|
||||
await toolbar.openPane('feature-tree')
|
||||
const operationButton = await toolbar.getFeatureTreeOperation(
|
||||
'Helix',
|
||||
0
|
||||
)
|
||||
await operationButton.dblclick()
|
||||
const initialInput = '100'
|
||||
const newInput = '50'
|
||||
await cmdBar.expectState({
|
||||
commandName: 'Helix',
|
||||
stage: 'arguments',
|
||||
currentArgKey: 'length',
|
||||
currentArgValue: initialInput,
|
||||
headerArguments: {
|
||||
AngleStart: '0',
|
||||
CounterClockWise: '',
|
||||
Length: initialInput,
|
||||
Radius: '1',
|
||||
Revolutions: '20',
|
||||
},
|
||||
highlightedHeaderArg: 'length',
|
||||
})
|
||||
await expect(cmdBar.currentArgumentInput).toBeVisible()
|
||||
await cmdBar.currentArgumentInput
|
||||
.locator('.cm-content')
|
||||
.fill(newInput)
|
||||
await cmdBar.progressCmdBar()
|
||||
await cmdBar.expectState({
|
||||
stage: 'review',
|
||||
headerArguments: {
|
||||
AngleStart: '0',
|
||||
CounterClockWise: '',
|
||||
Length: newInput,
|
||||
Radius: '1',
|
||||
Revolutions: '20',
|
||||
},
|
||||
commandName: 'Helix',
|
||||
})
|
||||
await cmdBar.progressCmdBar()
|
||||
await toolbar.closePane('feature-tree')
|
||||
await toolbar.openPane('code')
|
||||
await editor.expectEditor.toContain(expectedEditedOutput)
|
||||
await toolbar.closePane('code')
|
||||
})
|
||||
|
||||
await test.step('Delete helix via feature tree selection', async () => {
|
||||
await toolbar.openPane('feature-tree')
|
||||
const operationButton = await toolbar.getFeatureTreeOperation(
|
||||
'Helix',
|
||||
0
|
||||
)
|
||||
await operationButton.click({ button: 'left' })
|
||||
await page.keyboard.press('Delete')
|
||||
await editor.expectEditor.not.toContain(expectedEditedOutput)
|
||||
await expect(
|
||||
await toolbar.getFeatureTreeOperation('Helix', 0)
|
||||
).not.toBeVisible()
|
||||
})
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
const loftPointAndClickCases = [
|
||||
{ shouldPreselect: true },
|
||||
{ shouldPreselect: false },
|
||||
@ -1342,8 +1497,7 @@ loft001 = loft([sketch001, sketch002])
|
||||
{
|
||||
targetType: 'circle',
|
||||
testPoint: { x: 700, y: 250 },
|
||||
initialCode: `@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn('YZ')
|
||||
initialCode: `sketch001 = startSketchOn('YZ')
|
||||
profile001 = circle(sketch001, center = [0, 0], radius = 500)
|
||||
sketch002 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
@ -1353,8 +1507,7 @@ sketch002 = startSketchOn('XZ')
|
||||
{
|
||||
targetType: 'rectangle',
|
||||
testPoint: { x: 710, y: 255 },
|
||||
initialCode: `@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn('YZ')
|
||||
initialCode: `sketch001 = startSketchOn('YZ')
|
||||
profile001 = startProfileAt([-400, -400], sketch001)
|
||||
|> angledLine([0, 800], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
@ -1511,8 +1664,7 @@ sketch002 = startSketchOn('XZ')
|
||||
toolbar,
|
||||
cmdBar,
|
||||
}) => {
|
||||
const initialCode = `@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(YZ)
|
||||
const initialCode = `sketch001 = startSketchOn(YZ)
|
||||
|> circle(
|
||||
center = [0, 0],
|
||||
radius = 500
|
||||
@ -2079,8 +2231,7 @@ extrude001 = extrude(profile001, length = 5)
|
||||
cmdBar,
|
||||
}) => {
|
||||
// Code samples
|
||||
const initialCode = `@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XY)
|
||||
const initialCode = `sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-12, -6], %)
|
||||
|> line(end = [0, 12])
|
||||
|> line(end = [24, 0])
|
||||
@ -2304,8 +2455,7 @@ extrude001 = extrude(sketch001, length = -12)
|
||||
toolbar,
|
||||
}) => {
|
||||
// Code samples
|
||||
const initialCode = `@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XY)
|
||||
const initialCode = `sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-12, -6], %)
|
||||
|> line(end = [0, 12])
|
||||
|> line(end = [24, 0], tag = $seg02)
|
||||
@ -2459,8 +2609,7 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])
|
||||
toolbar,
|
||||
cmdBar,
|
||||
}) => {
|
||||
const initialCode = `@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
const initialCode = `sketch001 = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = 30)
|
||||
extrude001 = extrude(sketch001, length = 30)
|
||||
`
|
||||
@ -2595,8 +2744,7 @@ extrude001 = extrude(sketch001, length = 30)
|
||||
toolbar,
|
||||
cmdBar,
|
||||
}) => {
|
||||
const initialCode = `@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XY)
|
||||
const initialCode = `sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-20, 20], %)
|
||||
|> xLine(length = 40)
|
||||
|> yLine(length = -60)
|
||||
@ -2714,8 +2862,7 @@ extrude001 = extrude(sketch001, length = 40)
|
||||
})
|
||||
|
||||
const shellSketchOnFacesCases = [
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = 100)
|
||||
|> extrude(length = 100)
|
||||
|
||||
@ -2723,8 +2870,7 @@ sketch002 = startSketchOn(sketch001, 'END')
|
||||
|> circle(center = [0, 0], radius = 50)
|
||||
|> extrude(length = 50)
|
||||
`,
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = 100)
|
||||
extrude001 = extrude(sketch001, length = 100)
|
||||
|
||||
@ -3120,8 +3266,7 @@ radius = 8.69
|
||||
toolbar,
|
||||
cmdBar,
|
||||
}) => {
|
||||
const initialCode = `@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
const initialCode = `sketch001 = startSketchOn(XZ)
|
||||
profile001 = circle(
|
||||
sketch001,
|
||||
center = [0, 0],
|
||||
|
@ -86,7 +86,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
@ -123,7 +123,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
const errorDir = path.join(dir, 'broken-code')
|
||||
@ -191,7 +191,7 @@ test(
|
||||
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText = `Expected a tag declarator`
|
||||
const crypticErrorText = `The arg tag was given, but it was the wrong type`
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
|
||||
// black pixel means the scene has been cleared.
|
||||
@ -212,7 +212,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
const emptyDir = path.join(dir, 'empty')
|
||||
@ -289,7 +289,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
|
||||
@ -355,7 +355,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
await fsp.copyFile(
|
||||
@ -409,7 +409,7 @@ test(
|
||||
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText = `Expected a tag declarator`
|
||||
const crypticErrorText = `The arg tag was given, but it was the wrong type`
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
|
||||
// black pixel means the scene has been cleared.
|
||||
@ -453,7 +453,7 @@ test(
|
||||
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText = `Expected a tag declarator`
|
||||
const crypticErrorText = `The arg tag was given, but it was the wrong type`
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
}
|
||||
)
|
||||
@ -474,7 +474,7 @@ test.describe('Can export from electron app', () => {
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
@ -1497,12 +1497,7 @@ test(
|
||||
|
||||
await u.waitForPageLoad()
|
||||
|
||||
// The file should be prepopulated with the user's unit settings.
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
'@settings(defaultLengthUnit = in)'
|
||||
)
|
||||
|
||||
await page.locator('.cm-content').fill(`sketch001 = startSketchOn('XZ')
|
||||
await page.locator('.cm-content').fill(`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([-87.4, 282.92], %)
|
||||
|> line(end = [324.07, 27.199], tag = $seg01)
|
||||
|> line(end = [118.328, -291.754])
|
||||
|
@ -4,9 +4,9 @@ import path from 'path'
|
||||
import * as fsp from 'fs/promises'
|
||||
import {
|
||||
getUtils,
|
||||
executorInputPath,
|
||||
TEST_COLORS,
|
||||
TestColor,
|
||||
executorInputPath,
|
||||
orRunWhenFullSuiteEnabled,
|
||||
} from './test-utils'
|
||||
import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates'
|
||||
@ -582,7 +582,7 @@ extrude002 = extrude(profile002, length = 150)
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
@ -632,13 +632,12 @@ extrude002 = extrude(profile002, length = 150)
|
||||
|
||||
await test.step(`Load an empty file`, async () => {
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem('persistCode', '@settings(defaultLengthUnit = in)')
|
||||
localStorage.setItem('persistCode', '')
|
||||
})
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
await homePage.goToModelingScene()
|
||||
await u.waitForPageLoad()
|
||||
await u.closeKclCodePanel()
|
||||
await page.waitForTimeout(20)
|
||||
})
|
||||
|
||||
await test.step(`Zoom out until you can't see the default planes`, async () => {
|
||||
@ -647,14 +646,13 @@ extrude002 = extrude(profile002, length = 150)
|
||||
timeout: 5000,
|
||||
message: 'Plane color is visible',
|
||||
})
|
||||
.toBeLessThanOrEqual(20)
|
||||
.toBeLessThanOrEqual(15)
|
||||
|
||||
let maxZoomOuts = 10
|
||||
let middlePixelIsBackgroundColor =
|
||||
(await middlePixelIsColor(bgColor)) < 10
|
||||
while (!middlePixelIsBackgroundColor && maxZoomOuts > 0) {
|
||||
await page.keyboard.down('Control')
|
||||
await page.waitForTimeout(20)
|
||||
await page.mouse.move(600, 460)
|
||||
await page.mouse.down({ button: 'right' })
|
||||
await page.mouse.move(600, 50, { steps: 20 })
|
||||
@ -662,7 +660,7 @@ extrude002 = extrude(profile002, length = 150)
|
||||
await page.keyboard.up('Control')
|
||||
await page.waitForTimeout(100)
|
||||
maxZoomOuts--
|
||||
middlePixelIsBackgroundColor = (await middlePixelIsColor(bgColor)) < 15
|
||||
middlePixelIsBackgroundColor = (await middlePixelIsColor(bgColor)) < 10
|
||||
}
|
||||
|
||||
expect(middlePixelIsBackgroundColor, {
|
||||
@ -680,12 +678,13 @@ extrude002 = extrude(profile002, length = 150)
|
||||
homePage,
|
||||
scene,
|
||||
toolbar,
|
||||
viewport,
|
||||
}) => {
|
||||
await context.folderSetupFn(async (dir) => {
|
||||
const legoDir = path.join(dir, 'lego')
|
||||
await fsp.mkdir(legoDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('e2e-can-sketch-on-chamfer.kcl'),
|
||||
executorInputPath('lego.kcl'),
|
||||
path.join(legoDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
@ -698,8 +697,11 @@ extrude002 = extrude(profile002, length = 150)
|
||||
await scene.loadingIndicator.waitFor({ state: 'detached' })
|
||||
})
|
||||
await test.step(`The part should start loading quickly, not waiting until execution is complete`, async () => {
|
||||
// TODO: use the viewport size to pick the center point, but the `viewport` fixutre's values were wrong.
|
||||
await scene.expectPixelColor([143, 143, 143], { x: 500, y: 250 }, 15)
|
||||
await scene.expectPixelColor(
|
||||
[143, 143, 143],
|
||||
{ x: (viewport?.width ?? 1200) / 2, y: (viewport?.height ?? 500) / 2 },
|
||||
15
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -113,8 +113,7 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => {
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([2.61, -4.01], %)
|
||||
|> xLine(length = 8.73)
|
||||
|> tangentialArcTo([8.33, -1.31], %)`
|
||||
@ -160,10 +159,7 @@ sketch001 = startSketchOn(XZ)
|
||||
await page.mouse.click(700, 200)
|
||||
|
||||
await expect.poll(u.normalisedEditorCode, { timeout: 1000 })
|
||||
.toBe(`@settings(defaultLengthUnit = in)
|
||||
|
||||
|
||||
sketch002 = startSketchOn(XZ)
|
||||
.toBe(`sketch002 = startSketchOn(XZ)
|
||||
sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
||||
|> yLine(length = 12.34)
|
||||
|
||||
@ -793,8 +789,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
||||
200
|
||||
)
|
||||
|
||||
let codeStr =
|
||||
'@settings(defaultLengthUnit = in)sketch001 = startSketchOn(XY)'
|
||||
let codeStr = 'sketch001 = startSketchOn(XY)'
|
||||
|
||||
await page.mouse.click(center.x, viewportSize.height * 0.55)
|
||||
await expect(u.codeLocator).toHaveText(codeStr)
|
||||
@ -1431,8 +1426,7 @@ test.describe(`Sketching with offset planes`, () => {
|
||||
await context.addInitScript(() => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`@settings(defaultLengthUnit = in)
|
||||
offsetPlane001 = offsetPlane(XY, offset = 10)`
|
||||
`offsetPlane001 = offsetPlane(XY, offset = 10)`
|
||||
)
|
||||
})
|
||||
|
||||
@ -1446,7 +1440,7 @@ offsetPlane001 = offsetPlane(XY, offset = 10)`
|
||||
await test.step(`Hovering should highlight code`, async () => {
|
||||
await planeHover()
|
||||
await editor.expectState({
|
||||
activeLines: [`@settings(defaultLengthUnit = in)`],
|
||||
activeLines: [`offsetPlane001=offsetPlane(XY,offset=10)`],
|
||||
diagnostics: [],
|
||||
highlightedCode: 'offsetPlane(XY, offset = 10)',
|
||||
})
|
||||
@ -1459,7 +1453,7 @@ offsetPlane001 = offsetPlane(XY, offset = 10)`
|
||||
await expect(toolbar.lineBtn).toBeEnabled()
|
||||
await editor.expectEditor.toContain('startSketchOn(offsetPlane001)')
|
||||
await editor.expectState({
|
||||
activeLines: [`@settings(defaultLengthUnit = in)`],
|
||||
activeLines: [`offsetPlane001=offsetPlane(XY,offset=10)`],
|
||||
diagnostics: [],
|
||||
highlightedCode: '',
|
||||
})
|
||||
@ -2492,11 +2486,7 @@ extrude001 = extrude(profile003, length = 5)
|
||||
page,
|
||||
}) => {
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`@settings(defaultLengthUnit = in)
|
||||
myVar = 5`
|
||||
)
|
||||
localStorage.setItem('persistCode', `myVar = 5`)
|
||||
})
|
||||
|
||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
||||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 68 KiB |
@ -29,5 +29,5 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"kcl_version": "0.2.52"
|
||||
"kcl_version": "0.2.53"
|
||||
}
|
96
e2e/playwright/test-utils.test.ts
Normal file
@ -0,0 +1,96 @@
|
||||
import {
|
||||
runningOnLinux,
|
||||
runningOnMac,
|
||||
runningOnWindows,
|
||||
orRunWhenFullSuiteEnabled,
|
||||
} from './test-utils'
|
||||
|
||||
describe('platform detection utilities', () => {
|
||||
const originalPlatform = process.platform
|
||||
|
||||
afterAll(() => {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: originalPlatform,
|
||||
})
|
||||
})
|
||||
|
||||
describe('runningOnLinux', () => {
|
||||
it('returns true on Linux', () => {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: 'linux',
|
||||
})
|
||||
expect(runningOnLinux()).toBe(true)
|
||||
})
|
||||
|
||||
it('returns false on other platforms', () => {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: 'darwin',
|
||||
})
|
||||
expect(runningOnLinux()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('runningOnMac', () => {
|
||||
it('returns true on Mac', () => {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: 'darwin',
|
||||
})
|
||||
expect(runningOnMac()).toBe(true)
|
||||
})
|
||||
|
||||
it('returns false on other platforms', () => {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: 'linux',
|
||||
})
|
||||
expect(runningOnMac()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('runningOnWindows', () => {
|
||||
it('returns true on Windows', () => {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: 'win32',
|
||||
})
|
||||
expect(runningOnWindows()).toBe(true)
|
||||
})
|
||||
|
||||
it('returns false on other platforms', () => {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: 'linux',
|
||||
})
|
||||
expect(runningOnWindows()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('utility to bypass unreliable tests', () => {
|
||||
const originalEnv = { ...process.env }
|
||||
|
||||
afterAll(() => {
|
||||
process.env = { ...originalEnv }
|
||||
})
|
||||
it('always runs them on dedicated branch', () => {
|
||||
process.env.GITHUB_EVENT_NAME = 'push'
|
||||
process.env.GITHUB_REF = 'refs/heads/all-e2e'
|
||||
process.env.GITHUB_HEAD_REF = ''
|
||||
process.env.GITHUB_BASE_REF = ''
|
||||
const condition = orRunWhenFullSuiteEnabled()
|
||||
expect(condition).toBe(false)
|
||||
})
|
||||
it('skips them on the main branch', () => {
|
||||
process.env.GITHUB_EVENT_NAME = 'push'
|
||||
process.env.GITHUB_REF = 'refs/heads/main'
|
||||
process.env.GITHUB_HEAD_REF = ''
|
||||
process.env.GITHUB_BASE_REF = ''
|
||||
const condition = orRunWhenFullSuiteEnabled()
|
||||
expect(condition).toBe(true)
|
||||
})
|
||||
it('skips them on pull requests', () => {
|
||||
process.env.GITHUB_EVENT_NAME = 'pull_request'
|
||||
process.env.GITHUB_REF = 'refs/pull/5883/merge'
|
||||
process.env.GITHUB_HEAD_REF = 'my-branch'
|
||||
process.env.GITHUB_BASE_REF = 'main'
|
||||
const condition = orRunWhenFullSuiteEnabled()
|
||||
expect(condition).toBe(true)
|
||||
})
|
||||
})
|
@ -55,8 +55,21 @@ export const commonPoints = {
|
||||
export const editorSelector = '[role="textbox"][data-language="kcl"]'
|
||||
type PaneId = 'variables' | 'code' | 'files' | 'logs'
|
||||
|
||||
export function runningOnLinux() {
|
||||
return process.platform === 'linux'
|
||||
}
|
||||
|
||||
export function runningOnMac() {
|
||||
return process.platform === 'darwin'
|
||||
}
|
||||
|
||||
export function runningOnWindows() {
|
||||
return process.platform === 'win32'
|
||||
}
|
||||
|
||||
export function orRunWhenFullSuiteEnabled() {
|
||||
return process.env.GITHUB_HEAD_REF !== 'all-e2e'
|
||||
const branch = process.env.GITHUB_REF?.replace('refs/heads/', '')
|
||||
return branch !== 'all-e2e'
|
||||
}
|
||||
|
||||
async function waitForPageLoadWithRetry(page: Page) {
|
||||
|
@ -4,6 +4,7 @@ import {
|
||||
getUtils,
|
||||
TEST_COLORS,
|
||||
pollEditorLinesSelectedLength,
|
||||
executorInputPath,
|
||||
orRunWhenFullSuiteEnabled,
|
||||
} from './test-utils'
|
||||
import { XOR } from 'lib/utils'
|
||||
@ -1116,19 +1117,9 @@ test.describe('Electron constraint tests', () => {
|
||||
await context.folderSetupFn(async (dir) => {
|
||||
const bracketDir = path.join(dir, 'test-sample')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.writeFile(
|
||||
path.join(bracketDir, 'main.kcl'),
|
||||
`@settings(defaultLengthUnit = in)
|
||||
const part001 = startSketchOn(XY)
|
||||
|> startProfileAt([4.83, 12.56], %)
|
||||
|> line(end = [15.1, 2.48])
|
||||
|> line(end = [3.15, -9.85], tag = $seg01)
|
||||
|> line(end = [-15.17, -4.1])
|
||||
|> angledLine([segAng(seg01), 12.35], %)
|
||||
|> line(end = [-13.02, 10.03])
|
||||
|> close()
|
||||
|> extrude(length = 4)`,
|
||||
'utf-8'
|
||||
await fsp.copyFile(
|
||||
executorInputPath('angled_line.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
|
||||
|
@ -255,7 +255,7 @@ test.describe(`Testing gizmo, fixture-based`, () => {
|
||||
await context.addInitScript(() => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`@settings(defaultLengthUnit = in)
|
||||
`
|
||||
const sketch002 = startSketchOn(XZ)
|
||||
|> startProfileAt([-108.83, -57.48], %)
|
||||
|> angledLine([0, 105.13], %, $rectangleSegmentA001)
|
||||
|
@ -271,7 +271,7 @@ test.describe('Testing settings', () => {
|
||||
const bracketDir = join(dir, projectName)
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
executorInputPath('focusrite_scarlett_mounting_braket.kcl'),
|
||||
join(bracketDir, 'main.kcl')
|
||||
)
|
||||
}
|
||||
@ -746,6 +746,7 @@ test.describe('Testing settings', () => {
|
||||
})
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
await homePage.goToModelingScene()
|
||||
await expect(toolbar.startSketchBtn).toBeEnabled({ timeout: 15_000 })
|
||||
await scene.settled(cmdBar)
|
||||
await page.waitForTimeout(1000)
|
||||
|
||||
@ -950,9 +951,9 @@ test.describe('Testing settings', () => {
|
||||
)
|
||||
})
|
||||
|
||||
await test.step(`Initial units from settings are ignored`, async () => {
|
||||
await test.step(`Initial units from settings`, async () => {
|
||||
await homePage.openProject('project-000')
|
||||
await expect(unitsIndicator).toHaveText('Current units are: mm')
|
||||
await expect(unitsIndicator).toHaveText('Current units are: in')
|
||||
})
|
||||
|
||||
await test.step(`Manually write inline settings`, async () => {
|
||||
|
@ -483,8 +483,7 @@ test('Sketch on face', async ({ page, homePage, scene, cmdBar, toolbar }) => {
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([3.29, 7.86], %)
|
||||
|> line(end = [2.48, 2.44])
|
||||
|> line(end = [2.66, 1.17])
|
||||
|
3
interface.d.ts
vendored
@ -44,6 +44,9 @@ export interface IElectronAPI {
|
||||
rm: typeof fs.rm
|
||||
stat: (path: string) => ReturnType<fs.stat>
|
||||
statIsDirectory: (path: string) => Promise<boolean>
|
||||
canReadWriteDirectory: (
|
||||
path: string
|
||||
) => Promise<{ value: boolean; error: unknown }>
|
||||
path: typeof path
|
||||
mkdir: typeof fs.mkdir
|
||||
join: typeof path.join
|
||||
|
@ -75,17 +75,14 @@ LabeledArgument { ArgumentLabel Equals expression }
|
||||
ArgumentList { "(" commaSep<LabeledArgument | expression> ")" }
|
||||
|
||||
type[@isGroup=Type] {
|
||||
@specialize[@name=PrimitiveType]<
|
||||
identifier,
|
||||
"bool" | "number" | "string" | "tag" | "Sketch" | "SketchSurface" | "Solid" | "Plane"
|
||||
> |
|
||||
PrimitiveType { identifier } |
|
||||
ArrayType { "[" type !member (";" Number "+"?)? "]" } |
|
||||
ObjectType { "{" commaSep<ObjectProperty { PropertyName ":" type }> "}" }
|
||||
}
|
||||
|
||||
VariableDefinition { identifier }
|
||||
|
||||
VariableName { identifier }
|
||||
VariableName { identifier ("::" identifier)*}
|
||||
|
||||
ArgumentLabel { identifier }
|
||||
|
||||
@ -137,7 +134,7 @@ commaSep1NoTrailingComma<term> { term ("," term)* }
|
||||
"(" ")"
|
||||
"{" "}"
|
||||
"[" "]"
|
||||
"," "?" ":" "." ".." ";"
|
||||
"," "?" ":" "." ".." ";" "::"
|
||||
}
|
||||
|
||||
@external propSource kclHighlight from "./highlight"
|
||||
|
@ -18,7 +18,9 @@ const config = defineConfig({
|
||||
environment: 'node',
|
||||
reporters: process.env.GITHUB_ACTIONS
|
||||
? ['dot', 'github-actions']
|
||||
: ['verbose', 'hanging-process'],
|
||||
: // Gotcha: 'hanging-process' is very noisey, turn off by default on localhost
|
||||
// : ['verbose', 'hanging-process'],
|
||||
['verbose'],
|
||||
testTimeout: 1000,
|
||||
hookTimeout: 1000,
|
||||
teardownTimeout: 1000,
|
||||
|
@ -29,7 +29,7 @@
|
||||
"vscode-uri": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.13.10",
|
||||
"@types/node": "^22.13.13",
|
||||
"ts-node": "^10.9.2"
|
||||
}
|
||||
}
|
||||
|
@ -116,10 +116,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
|
||||
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
|
||||
|
||||
"@types/node@^22.13.10":
|
||||
version "22.13.10"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.10.tgz#df9ea358c5ed991266becc3109dc2dc9125d77e4"
|
||||
integrity sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==
|
||||
"@types/node@^22.13.13":
|
||||
version "22.13.13"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.13.tgz#5e7d110fb509b0d4a43fbf48fa9d6e0f83e1b1e7"
|
||||
integrity sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==
|
||||
dependencies:
|
||||
undici-types "~6.20.0"
|
||||
|
||||
|
@ -12,6 +12,7 @@ import { defineConfig, devices } from '@playwright/test'
|
||||
export default defineConfig({
|
||||
timeout: 120_000, // override the default 30s timeout
|
||||
testDir: './e2e/playwright',
|
||||
testIgnore: '*.test.ts', // ignore unit tests
|
||||
/* Run tests in files in parallel */
|
||||
fullyParallel: true,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
|
20
rust/Cargo.lock
generated
@ -1780,7 +1780,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-bumper"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1791,7 +1791,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-derive-docs"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"anyhow",
|
||||
@ -1810,7 +1810,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-directory-test-macro"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -1819,7 +1819,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-language-server"
|
||||
version = "0.2.52"
|
||||
version = "0.2.54"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1840,7 +1840,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-language-server-release"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1860,7 +1860,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-lib"
|
||||
version = "0.2.52"
|
||||
version = "0.2.54"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"approx 0.5.1",
|
||||
@ -1928,7 +1928,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-python-bindings"
|
||||
version = "0.3.52"
|
||||
version = "0.3.54"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"kcl-lib",
|
||||
@ -1943,7 +1943,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-test-server"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"hyper 0.14.32",
|
||||
@ -1956,7 +1956,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-to-core"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@ -1970,7 +1970,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-wasm-lib"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
dependencies = [
|
||||
"bson",
|
||||
"console_error_panic_hook",
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
[package]
|
||||
name = "kcl-bumper"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/KittyCAD/modeling-api"
|
||||
rust-version = "1.76"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "kcl-derive-docs"
|
||||
description = "A tool for generating documentation from Rust derive macros"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
|
@ -816,7 +816,7 @@ fn generate_code_block_test(fn_name: &str, code_block: &str, index: usize) -> pr
|
||||
async fn #test_name() -> miette::Result<()> {
|
||||
let code = #code_block;
|
||||
// Note, `crate` must be kcl_lib
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(code, crate::settings::types::UnitLength::Mm, None).await {
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -31,7 +31,13 @@ mod test_examples_someFn {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_someFn0() -> miette::Result<()> {
|
||||
let code = "someFn()";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -31,7 +31,13 @@ mod test_examples_someFn {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_someFn0() -> miette::Result<()> {
|
||||
let code = "someFn()";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -32,7 +32,13 @@ mod test_examples_show {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_show0() -> miette::Result<()> {
|
||||
let code = "This is another code block.\nyes sirrr.\nshow";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -32,7 +32,13 @@ mod test_examples_show {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_show0() -> miette::Result<()> {
|
||||
let code = "This is code.\nIt does other shit.\nshow";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -33,7 +33,13 @@ mod test_examples_my_func {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_my_func0() -> miette::Result<()> {
|
||||
let code = "This is another code block.\nyes sirrr.\nmyFunc";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -33,7 +33,13 @@ mod test_examples_line_to {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_line_to0() -> miette::Result<()> {
|
||||
let code = "This is another code block.\nyes sirrr.\nlineTo";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -32,7 +32,13 @@ mod test_examples_min {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_min0() -> miette::Result<()> {
|
||||
let code = "This is another code block.\nyes sirrr.\nmin";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -32,7 +32,13 @@ mod test_examples_show {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_show0() -> miette::Result<()> {
|
||||
let code = "This is code.\nIt does other shit.\nshow";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -32,7 +32,13 @@ mod test_examples_import {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_import0() -> miette::Result<()> {
|
||||
let code = "This is code.\nIt does other shit.\nimport";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -32,7 +32,13 @@ mod test_examples_import {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_import0() -> miette::Result<()> {
|
||||
let code = "This is code.\nIt does other shit.\nimport";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -32,7 +32,13 @@ mod test_examples_import {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_import0() -> miette::Result<()> {
|
||||
let code = "This is code.\nIt does other shit.\nimport";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -32,7 +32,13 @@ mod test_examples_show {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_show0() -> miette::Result<()> {
|
||||
let code = "This is code.\nIt does other shit.\nshow";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -31,7 +31,13 @@ mod test_examples_some_function {
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 5)]
|
||||
async fn kcl_test_example_some_function0() -> miette::Result<()> {
|
||||
let code = "someFunction()";
|
||||
let result = match crate::test_server::execute_and_snapshot(code, None).await {
|
||||
let result = match crate::test_server::execute_and_snapshot(
|
||||
code,
|
||||
crate::settings::types::UnitLength::Mm,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Err(crate::errors::ExecError::Kcl(e)) => {
|
||||
return Err(miette::Report::new(crate::errors::Report {
|
||||
error: e.error,
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "kcl-directory-test-macro"
|
||||
description = "A tool for generating tests from a directory of kcl files"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "kcl-language-server-release"
|
||||
version = "0.1.52"
|
||||
version = "0.1.54"
|
||||
edition = "2021"
|
||||
authors = ["KittyCAD Inc <kcl@kittycad.io>"]
|
||||
publish = false
|
||||
|
@ -2,7 +2,7 @@
|
||||
name = "kcl-language-server"
|
||||
description = "A language server for KCL."
|
||||
authors = ["KittyCAD Inc <kcl@kittycad.io>"]
|
||||
version = "0.2.52"
|
||||
version = "0.2.54"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
@ -135,13 +135,13 @@
|
||||
"@types/mocha": "^10.0.10",
|
||||
"@types/node": "^22.13.10",
|
||||
"@types/vscode": "^1.97.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||
"@typescript-eslint/parser": "^6.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
||||
"@typescript-eslint/parser": "^8.27.0",
|
||||
"@vscode/test-electron": "^2.4.1",
|
||||
"@vscode/vsce": "^2.30.0",
|
||||
"@vscode/vsce": "^3.3.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild": "^0.25.1",
|
||||
"glob": "^10.4.3",
|
||||
"glob": "^11.0.1",
|
||||
"mocha": "^11.1.0",
|
||||
"typescript": "^5.8.2"
|
||||
},
|
||||
|
@ -252,7 +252,7 @@
|
||||
dependencies:
|
||||
eslint-visitor-keys "^3.4.3"
|
||||
|
||||
"@eslint-community/regexpp@^4.5.1":
|
||||
"@eslint-community/regexpp@^4.10.0":
|
||||
version "4.12.1"
|
||||
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0"
|
||||
integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==
|
||||
@ -308,11 +308,6 @@
|
||||
"@types/minimatch" "^5.1.2"
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/json-schema@^7.0.12":
|
||||
version "7.0.15"
|
||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
|
||||
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
||||
|
||||
"@types/minimatch@^5.1.2":
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca"
|
||||
@ -330,101 +325,91 @@
|
||||
dependencies:
|
||||
undici-types "~6.20.0"
|
||||
|
||||
"@types/semver@^7.5.0":
|
||||
version "7.5.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
|
||||
integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==
|
||||
|
||||
"@types/vscode@^1.97.0":
|
||||
version "1.97.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.97.0.tgz#62ce3a32243019aaa4fc20cee2a3de06bc71af4f"
|
||||
integrity sha512-ueE73loeOTe7olaVyqP9mrRI54kVPJifUPjblZo9fYcv1CuVLPOEKEkqW0GkqPC454+nCEoigLWnC2Pp7prZ9w==
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^6.6.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3"
|
||||
integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==
|
||||
"@typescript-eslint/eslint-plugin@^8.27.0":
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.27.0.tgz#fbef10802365832ee1d1bd5d2117dcec82727a72"
|
||||
integrity sha512-4henw4zkePi5p252c8ncBLzLce52SEUz2Ebj8faDnuUXz2UuHEONYcJ+G0oaCF+bYCWVZtrGzq3FD7YXetmnSA==
|
||||
dependencies:
|
||||
"@eslint-community/regexpp" "^4.5.1"
|
||||
"@typescript-eslint/scope-manager" "6.21.0"
|
||||
"@typescript-eslint/type-utils" "6.21.0"
|
||||
"@typescript-eslint/utils" "6.21.0"
|
||||
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||
debug "^4.3.4"
|
||||
"@eslint-community/regexpp" "^4.10.0"
|
||||
"@typescript-eslint/scope-manager" "8.27.0"
|
||||
"@typescript-eslint/type-utils" "8.27.0"
|
||||
"@typescript-eslint/utils" "8.27.0"
|
||||
"@typescript-eslint/visitor-keys" "8.27.0"
|
||||
graphemer "^1.4.0"
|
||||
ignore "^5.2.4"
|
||||
ignore "^5.3.1"
|
||||
natural-compare "^1.4.0"
|
||||
semver "^7.5.4"
|
||||
ts-api-utils "^1.0.1"
|
||||
ts-api-utils "^2.0.1"
|
||||
|
||||
"@typescript-eslint/parser@^6.6.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b"
|
||||
integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==
|
||||
"@typescript-eslint/parser@^8.27.0":
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.27.0.tgz#3f6beaa83934467eda34ae82ef04090014df8227"
|
||||
integrity sha512-XGwIabPallYipmcOk45DpsBSgLC64A0yvdAkrwEzwZ2viqGqRUJ8eEYoPz0CWnutgAFbNMPdsGGvzjSmcWVlEA==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "6.21.0"
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||
"@typescript-eslint/scope-manager" "8.27.0"
|
||||
"@typescript-eslint/types" "8.27.0"
|
||||
"@typescript-eslint/typescript-estree" "8.27.0"
|
||||
"@typescript-eslint/visitor-keys" "8.27.0"
|
||||
debug "^4.3.4"
|
||||
|
||||
"@typescript-eslint/scope-manager@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1"
|
||||
integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==
|
||||
"@typescript-eslint/scope-manager@8.27.0":
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.27.0.tgz#b51042927067d677fbfc471605cf40d1ffaee482"
|
||||
integrity sha512-8oI9GwPMQmBryaaxG1tOZdxXVeMDte6NyJA4i7/TWa4fBwgnAXYlIQP+uYOeqAaLJ2JRxlG9CAyL+C+YE9Xknw==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||
"@typescript-eslint/types" "8.27.0"
|
||||
"@typescript-eslint/visitor-keys" "8.27.0"
|
||||
|
||||
"@typescript-eslint/type-utils@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e"
|
||||
integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==
|
||||
"@typescript-eslint/type-utils@8.27.0":
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.27.0.tgz#af3c4eefcb64455ee50aae2d7069918467af085c"
|
||||
integrity sha512-wVArTVcz1oJOIEJxui/nRhV0TXzD/zMSOYi/ggCfNq78EIszddXcJb7r4RCp/oBrjt8n9A0BSxRMKxHftpDxDA==
|
||||
dependencies:
|
||||
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||
"@typescript-eslint/utils" "6.21.0"
|
||||
"@typescript-eslint/typescript-estree" "8.27.0"
|
||||
"@typescript-eslint/utils" "8.27.0"
|
||||
debug "^4.3.4"
|
||||
ts-api-utils "^1.0.1"
|
||||
ts-api-utils "^2.0.1"
|
||||
|
||||
"@typescript-eslint/types@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d"
|
||||
integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==
|
||||
"@typescript-eslint/types@8.27.0":
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.27.0.tgz#3dd01ced4c81e798d1106fda0904f8d5c91051aa"
|
||||
integrity sha512-/6cp9yL72yUHAYq9g6DsAU+vVfvQmd1a8KyA81uvfDE21O2DwQ/qxlM4AR8TSdAu+kJLBDrEHKC5/W2/nxsY0A==
|
||||
|
||||
"@typescript-eslint/typescript-estree@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46"
|
||||
integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==
|
||||
"@typescript-eslint/typescript-estree@8.27.0":
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.27.0.tgz#4e02a1056454a84418cc9bce7c00b1c08b03567a"
|
||||
integrity sha512-BnKq8cqPVoMw71O38a1tEb6iebEgGA80icSxW7g+kndx0o6ot6696HjG7NdgfuAVmVEtwXUr3L8R9ZuVjoQL6A==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||
"@typescript-eslint/types" "8.27.0"
|
||||
"@typescript-eslint/visitor-keys" "8.27.0"
|
||||
debug "^4.3.4"
|
||||
globby "^11.1.0"
|
||||
fast-glob "^3.3.2"
|
||||
is-glob "^4.0.3"
|
||||
minimatch "9.0.3"
|
||||
semver "^7.5.4"
|
||||
ts-api-utils "^1.0.1"
|
||||
minimatch "^9.0.4"
|
||||
semver "^7.6.0"
|
||||
ts-api-utils "^2.0.1"
|
||||
|
||||
"@typescript-eslint/utils@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134"
|
||||
integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==
|
||||
"@typescript-eslint/utils@8.27.0":
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.27.0.tgz#d9c2a4891c6a85b952a9d5f9656c379ab111cf6d"
|
||||
integrity sha512-njkodcwH1yvmo31YWgRHNb/x1Xhhq4/m81PhtvmRngD8iHPehxffz1SNCO+kwaePhATC+kOa/ggmvPoPza5i0Q==
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils" "^4.4.0"
|
||||
"@types/json-schema" "^7.0.12"
|
||||
"@types/semver" "^7.5.0"
|
||||
"@typescript-eslint/scope-manager" "6.21.0"
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||
semver "^7.5.4"
|
||||
"@typescript-eslint/scope-manager" "8.27.0"
|
||||
"@typescript-eslint/types" "8.27.0"
|
||||
"@typescript-eslint/typescript-estree" "8.27.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47"
|
||||
integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==
|
||||
"@typescript-eslint/visitor-keys@8.27.0":
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.27.0.tgz#4a13e9d7ad7e311a07ea1b178b4c9f848ce11334"
|
||||
integrity sha512-WsXQwMkILJvffP6z4U3FYJPlbf/j07HIxmDjZpbNvBJkMfvwXj5ACRkkHwBDvLBbDbtX5TdU64/rcvKJ/vuInQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
eslint-visitor-keys "^3.4.1"
|
||||
"@typescript-eslint/types" "8.27.0"
|
||||
eslint-visitor-keys "^4.2.0"
|
||||
|
||||
"@vscode/test-electron@^2.4.1":
|
||||
version "2.4.1"
|
||||
@ -497,10 +482,10 @@
|
||||
"@vscode/vsce-sign-win32-arm64" "2.0.2"
|
||||
"@vscode/vsce-sign-win32-x64" "2.0.2"
|
||||
|
||||
"@vscode/vsce@^2.30.0":
|
||||
version "2.30.0"
|
||||
resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-2.30.0.tgz#7a0c16b20ef529fa291fe9d3c7fe51a2a613f773"
|
||||
integrity sha512-MBYpXdCY1SCdc2u/y11kmJuSODKFyZRpeRTQq5p4rSg05QSjSy5pz6h/BGLNdSahgXfKRBATEkjAcJFdJuDz8Q==
|
||||
"@vscode/vsce@^3.3.0":
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@vscode/vsce/-/vsce-3.3.0.tgz#803e41368a95d35693ce049076503f34f89fde09"
|
||||
integrity sha512-HA/pUyvh/TQWkc4wG7AudPIWUvsR8i4jiWZZgM/a69ncPi9Nm5FDogf/wVEk4EWJs4/UdxU7J6X18dfAwfPbxA==
|
||||
dependencies:
|
||||
"@azure/identity" "^4.1.0"
|
||||
"@vscode/vsce-sign" "^2.0.0"
|
||||
@ -508,19 +493,19 @@
|
||||
chalk "^2.4.2"
|
||||
cheerio "^1.0.0-rc.9"
|
||||
cockatiel "^3.1.2"
|
||||
commander "^6.2.1"
|
||||
commander "^12.1.0"
|
||||
form-data "^4.0.0"
|
||||
glob "^7.0.6"
|
||||
glob "^11.0.0"
|
||||
hosted-git-info "^4.0.2"
|
||||
jsonc-parser "^3.2.0"
|
||||
leven "^3.1.0"
|
||||
markdown-it "^12.3.2"
|
||||
markdown-it "^14.1.0"
|
||||
mime "^1.3.4"
|
||||
minimatch "^3.0.3"
|
||||
parse-semver "^1.1.1"
|
||||
read "^1.0.7"
|
||||
semver "^7.5.2"
|
||||
tmp "^0.2.1"
|
||||
tmp "^0.2.3"
|
||||
typed-rest-client "^1.8.4"
|
||||
url-join "^4.0.1"
|
||||
xml2js "^0.5.0"
|
||||
@ -583,11 +568,6 @@ argparse@^2.0.1:
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
|
||||
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
|
||||
|
||||
array-union@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
|
||||
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
@ -832,10 +812,10 @@ combined-stream@^1.0.8:
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
commander@^6.2.1:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
|
||||
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==
|
||||
commander@^12.1.0:
|
||||
version "12.1.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3"
|
||||
integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
@ -932,13 +912,6 @@ diff@^5.2.0:
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
|
||||
integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==
|
||||
|
||||
dir-glob@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
|
||||
integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==
|
||||
dependencies:
|
||||
path-type "^4.0.0"
|
||||
|
||||
dom-serializer@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53"
|
||||
@ -1008,11 +981,6 @@ entities@^4.2.0, entities@^4.4.0:
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
|
||||
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
|
||||
|
||||
entities@~2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
|
||||
integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==
|
||||
|
||||
es-define-property@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845"
|
||||
@ -1071,11 +1039,16 @@ escape-string-regexp@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
|
||||
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
|
||||
|
||||
eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3:
|
||||
eslint-visitor-keys@^3.4.3:
|
||||
version "3.4.3"
|
||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
|
||||
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
|
||||
|
||||
eslint-visitor-keys@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45"
|
||||
integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==
|
||||
|
||||
events@^3.0.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
|
||||
@ -1086,7 +1059,7 @@ expand-template@^2.0.3:
|
||||
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
|
||||
integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
|
||||
|
||||
fast-glob@^3.2.9:
|
||||
fast-glob@^3.3.2:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818"
|
||||
integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==
|
||||
@ -1153,11 +1126,6 @@ fs-constants@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
|
||||
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
@ -1196,7 +1164,7 @@ glob-parent@^5.1.2, glob-parent@~5.1.2:
|
||||
dependencies:
|
||||
is-glob "^4.0.1"
|
||||
|
||||
glob@^10.4.3, glob@^10.4.5:
|
||||
glob@^10.4.5:
|
||||
version "10.4.5"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956"
|
||||
integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==
|
||||
@ -1208,29 +1176,17 @@ glob@^10.4.3, glob@^10.4.5:
|
||||
package-json-from-dist "^1.0.0"
|
||||
path-scurry "^1.11.1"
|
||||
|
||||
glob@^7.0.6:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
||||
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
||||
glob@^11.0.0, glob@^11.0.1:
|
||||
version "11.0.1"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-11.0.1.tgz#1c3aef9a59d680e611b53dcd24bb8639cef064d9"
|
||||
integrity sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.1.1"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
globby@^11.1.0:
|
||||
version "11.1.0"
|
||||
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
|
||||
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
|
||||
dependencies:
|
||||
array-union "^2.1.0"
|
||||
dir-glob "^3.0.1"
|
||||
fast-glob "^3.2.9"
|
||||
ignore "^5.2.0"
|
||||
merge2 "^1.4.1"
|
||||
slash "^3.0.0"
|
||||
foreground-child "^3.1.0"
|
||||
jackspeak "^4.0.1"
|
||||
minimatch "^10.0.0"
|
||||
minipass "^7.1.2"
|
||||
package-json-from-dist "^1.0.0"
|
||||
path-scurry "^2.0.0"
|
||||
|
||||
gopd@^1.0.1:
|
||||
version "1.0.1"
|
||||
@ -1321,7 +1277,7 @@ ieee754@^1.1.13, ieee754@^1.2.1:
|
||||
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
|
||||
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
|
||||
|
||||
ignore@^5.2.0, ignore@^5.2.4:
|
||||
ignore@^5.3.1:
|
||||
version "5.3.2"
|
||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5"
|
||||
integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==
|
||||
@ -1331,15 +1287,7 @@ immediate@~3.0.5:
|
||||
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
|
||||
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3:
|
||||
inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
@ -1429,6 +1377,13 @@ jackspeak@^3.1.2:
|
||||
optionalDependencies:
|
||||
"@pkgjs/parseargs" "^0.11.0"
|
||||
|
||||
jackspeak@^4.0.1:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-4.1.0.tgz#c489c079f2b636dc4cbe9b0312a13ff1282e561b"
|
||||
integrity sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==
|
||||
dependencies:
|
||||
"@isaacs/cliui" "^8.0.2"
|
||||
|
||||
js-yaml@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
|
||||
@ -1521,12 +1476,12 @@ lie@~3.3.0:
|
||||
dependencies:
|
||||
immediate "~3.0.5"
|
||||
|
||||
linkify-it@^3.0.1:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e"
|
||||
integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==
|
||||
linkify-it@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421"
|
||||
integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==
|
||||
dependencies:
|
||||
uc.micro "^1.0.1"
|
||||
uc.micro "^2.0.0"
|
||||
|
||||
locate-path@^6.0.0:
|
||||
version "6.0.0"
|
||||
@ -1591,6 +1546,11 @@ lru-cache@^10.2.0:
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878"
|
||||
integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==
|
||||
|
||||
lru-cache@^11.0.0:
|
||||
version "11.0.2"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.0.2.tgz#fbd8e7cf8211f5e7e5d91905c415a3f55755ca39"
|
||||
integrity sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==
|
||||
|
||||
lru-cache@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
|
||||
@ -1598,23 +1558,24 @@ lru-cache@^6.0.0:
|
||||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
markdown-it@^12.3.2:
|
||||
version "12.3.2"
|
||||
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90"
|
||||
integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==
|
||||
markdown-it@^14.1.0:
|
||||
version "14.1.0"
|
||||
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45"
|
||||
integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==
|
||||
dependencies:
|
||||
argparse "^2.0.1"
|
||||
entities "~2.1.0"
|
||||
linkify-it "^3.0.1"
|
||||
mdurl "^1.0.1"
|
||||
uc.micro "^1.0.5"
|
||||
entities "^4.4.0"
|
||||
linkify-it "^5.0.0"
|
||||
mdurl "^2.0.0"
|
||||
punycode.js "^2.3.1"
|
||||
uc.micro "^2.1.0"
|
||||
|
||||
mdurl@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
|
||||
integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==
|
||||
mdurl@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0"
|
||||
integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==
|
||||
|
||||
merge2@^1.3.0, merge2@^1.4.1:
|
||||
merge2@^1.3.0:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
|
||||
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
||||
@ -1654,14 +1615,14 @@ mimic-response@^3.1.0:
|
||||
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9"
|
||||
integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==
|
||||
|
||||
minimatch@9.0.3:
|
||||
version "9.0.3"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
|
||||
integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==
|
||||
minimatch@^10.0.0:
|
||||
version "10.0.1"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.0.1.tgz#ce0521856b453c86e25f2c4c0d03e6ff7ddc440b"
|
||||
integrity sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==
|
||||
dependencies:
|
||||
brace-expansion "^2.0.1"
|
||||
|
||||
minimatch@^3.0.3, minimatch@^3.1.1:
|
||||
minimatch@^3.0.3:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
@ -1777,7 +1738,7 @@ object-inspect@^1.13.1:
|
||||
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2"
|
||||
integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==
|
||||
|
||||
once@^1.3.0, once@^1.3.1, once@^1.4.0:
|
||||
once@^1.3.1, once@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
||||
@ -1866,11 +1827,6 @@ path-exists@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
|
||||
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
||||
|
||||
path-key@^3.1.0:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
|
||||
@ -1884,10 +1840,13 @@ path-scurry@^1.11.1:
|
||||
lru-cache "^10.2.0"
|
||||
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||
|
||||
path-type@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
|
||||
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
|
||||
path-scurry@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.0.tgz#9f052289f23ad8bf9397a2a0425e7b8615c58580"
|
||||
integrity sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==
|
||||
dependencies:
|
||||
lru-cache "^11.0.0"
|
||||
minipass "^7.1.2"
|
||||
|
||||
pend@~1.2.0:
|
||||
version "1.2.0"
|
||||
@ -1930,6 +1889,11 @@ pump@^3.0.0:
|
||||
end-of-stream "^1.1.0"
|
||||
once "^1.3.1"
|
||||
|
||||
punycode.js@^2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7"
|
||||
integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==
|
||||
|
||||
qs@^6.9.1:
|
||||
version "6.12.1"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a"
|
||||
@ -2040,10 +2004,10 @@ semver@^5.1.0:
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
|
||||
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
|
||||
|
||||
semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.4, semver@^7.6.2:
|
||||
version "7.6.2"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
|
||||
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==
|
||||
semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2:
|
||||
version "7.7.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f"
|
||||
integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==
|
||||
|
||||
serialize-javascript@^6.0.2:
|
||||
version "6.0.2"
|
||||
@ -2115,11 +2079,6 @@ simple-get@^4.0.0:
|
||||
once "^1.3.1"
|
||||
simple-concat "^1.0.0"
|
||||
|
||||
slash@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
|
||||
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
|
||||
|
||||
stdin-discarder@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/stdin-discarder/-/stdin-discarder-0.1.0.tgz#22b3e400393a8e28ebf53f9958f3880622efde21"
|
||||
@ -2255,7 +2214,7 @@ tar-stream@^2.1.4:
|
||||
inherits "^2.0.3"
|
||||
readable-stream "^3.1.1"
|
||||
|
||||
tmp@^0.2.1:
|
||||
tmp@^0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae"
|
||||
integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==
|
||||
@ -2267,10 +2226,10 @@ to-regex-range@^5.0.1:
|
||||
dependencies:
|
||||
is-number "^7.0.0"
|
||||
|
||||
ts-api-utils@^1.0.1:
|
||||
version "1.4.3"
|
||||
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.4.3.tgz#bfc2215fe6528fecab2b0fba570a2e8a4263b064"
|
||||
integrity sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==
|
||||
ts-api-utils@^2.0.1:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.1.0.tgz#595f7094e46eed364c13fd23e75f9513d29baf91"
|
||||
integrity sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==
|
||||
|
||||
tslib@^2.2.0, tslib@^2.6.2:
|
||||
version "2.6.2"
|
||||
@ -2303,10 +2262,10 @@ typescript@^5.8.2:
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.2.tgz#8170b3702f74b79db2e5a96207c15e65807999e4"
|
||||
integrity sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==
|
||||
|
||||
uc.micro@^1.0.1, uc.micro@^1.0.5:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
|
||||
integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==
|
||||
uc.micro@^2.0.0, uc.micro@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee"
|
||||
integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==
|
||||
|
||||
underscore@^1.12.1:
|
||||
version "1.13.6"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "kcl-lib"
|
||||
description = "KittyCAD Language implementation and tools"
|
||||
version = "0.2.52"
|
||||
version = "0.2.54"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
|
@ -76,7 +76,7 @@ fn run_benchmarks(c: &mut Criterion) {
|
||||
group.bench_function(format!("execute_{}", dir_name), |b| {
|
||||
b.iter(|| {
|
||||
if let Err(err) = rt.block_on(async {
|
||||
let ctx = kcl_lib::ExecutorContext::new_with_default_client().await?;
|
||||
let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default()).await?;
|
||||
let mut exec_state = kcl_lib::ExecState::new(&ctx);
|
||||
ctx.run(black_box(&program), &mut exec_state).await?;
|
||||
ctx.close().await;
|
||||
|
@ -49,6 +49,45 @@ async fn cache_test(
|
||||
img_results
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cache_change_units_changes_output() {
|
||||
let code = r#"part001 = startSketchOn('XY')
|
||||
|> startProfileAt([5.5229, 5.25217], %)
|
||||
|> line(end = [10.50433, -1.19122])
|
||||
|> line(end = [8.01362, -5.48731])
|
||||
|> line(end = [-1.02877, -6.76825])
|
||||
|> line(end = [-11.53311, 2.81559])
|
||||
|> close()
|
||||
|> extrude(length = 4)
|
||||
"#;
|
||||
|
||||
let result = cache_test(
|
||||
"change_units_changes_output",
|
||||
vec![
|
||||
Variation {
|
||||
code,
|
||||
settings: &kcl_lib::ExecutorSettings {
|
||||
units: kcl_lib::UnitLength::In,
|
||||
..Default::default()
|
||||
},
|
||||
},
|
||||
Variation {
|
||||
code,
|
||||
settings: &kcl_lib::ExecutorSettings {
|
||||
units: kcl_lib::UnitLength::Mm,
|
||||
..Default::default()
|
||||
},
|
||||
},
|
||||
],
|
||||
)
|
||||
.await;
|
||||
|
||||
let first = result.first().unwrap();
|
||||
let second = result.last().unwrap();
|
||||
|
||||
assert!(first.1 != second.1);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cache_change_grid_visualizes_grid_off_to_on() {
|
||||
let code = r#"part001 = startSketchOn('XY')
|
||||
|
@ -1,4 +0,0 @@
|
||||
@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = 20)
|
||||
extrude001 = extrude(sketch001, length = 10)
|
@ -1,5 +1,4 @@
|
||||
@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
const sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([75.8, 317.2], %)
|
||||
|> angledLine([0, 268.43], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
@ -12,8 +11,8 @@ sketch001 = startSketchOn(XZ)
|
||||
], %, $yo)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||
|> close()
|
||||
extrude001 = extrude(sketch001, length = 100)
|
||||
chamf = chamfer(
|
||||
const extrude001 = extrude(sketch001, length = 100)
|
||||
const chamf = chamfer(
|
||||
extrude001,
|
||||
length = 30,
|
||||
tags = [
|
||||
|
@ -1,5 +1,4 @@
|
||||
@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
const sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([75.8, 317.2], %) // [$startCapTag, $EndCapTag]
|
||||
|> angledLine([0, 268.43], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
@ -12,7 +11,7 @@ sketch001 = startSketchOn(XZ)
|
||||
], %, $yo)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||
|> close()
|
||||
extrude001 = extrude(sketch001, length = 100)
|
||||
const extrude001 = extrude(sketch001, length = 100)
|
||||
|> chamfer(
|
||||
length = 30,
|
||||
tags = [
|
||||
|
@ -1,4 +1,4 @@
|
||||
const part001 = startSketchOn(XY)
|
||||
|> circle(center= [5, 5], radius= 10)
|
||||
|> extrude(length = 10)
|
||||
|> helixRevolutions({revolutions = 16, angleStart = 0}, %)
|
||||
|> helix(revolutions = 16, angleStart = 0, cylinder = %)
|
||||
|
@ -1,4 +1,4 @@
|
||||
const part001 = startSketchOn(XY)
|
||||
|> circle(center = [5, 5], radius = 10)
|
||||
|> extrude(length = -10)
|
||||
|> helixRevolutions({revolutions = 16, angleStart = 0}, %)
|
||||
|> helix(revolutions = 16, angleStart = 0, cylinder = %)
|
||||
|
@ -1,4 +1,4 @@
|
||||
const part001 = startSketchOn(XY)
|
||||
|> circle(center= [5, 5], radius= 10)
|
||||
|> extrude(length = 10)
|
||||
|> helixRevolutions({revolutions = 16, angleStart = 0, length = 3}, %)
|
||||
|> helix(revolutions = 16, angleStart = 0, length = 3, cylinder = %)
|
||||
|
@ -2,7 +2,7 @@ mod cache;
|
||||
|
||||
use kcl_lib::{
|
||||
test_server::{execute_and_export_step, execute_and_snapshot, execute_and_snapshot_no_auth},
|
||||
ExecError,
|
||||
ExecError, UnitLength,
|
||||
};
|
||||
|
||||
/// The minimum permissible difference between asserted twenty-twenty images.
|
||||
@ -26,7 +26,7 @@ pub(crate) fn assert_out(test_name: &str, result: &image::DynamicImage) -> Strin
|
||||
async fn kcl_test_fillet_duplicate_tags() {
|
||||
let code = kcl_input!("fillet_duplicate_tags");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
let err = result.expect_err("Code should have failed due to the duplicate edges being filletted");
|
||||
|
||||
let err = err.as_kcl_error().unwrap();
|
||||
@ -48,7 +48,7 @@ async fn kcl_test_execute_engine_error_return() {
|
||||
|> extrude(length = 4)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -61,7 +61,7 @@ async fn kcl_test_execute_i_shape() {
|
||||
// This is some code from lee that starts a pipe expression with a variable.
|
||||
let code = kcl_input!("i_shape");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("i_shape", &result);
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ async fn kcl_test_execute_i_shape() {
|
||||
async fn kcl_test_execute_pipes_on_pipes() {
|
||||
let code = kcl_input!("pipes_on_pipes");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("pipes_on_pipes", &result);
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ async fn kcl_test_execute_pipes_on_pipes() {
|
||||
async fn kcl_test_execute_cylinder() {
|
||||
let code = kcl_input!("cylinder");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("cylinder", &result);
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ async fn kcl_test_execute_cylinder() {
|
||||
async fn kcl_test_execute_kittycad_svg() {
|
||||
let code = kcl_input!("kittycad_svg");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("kittycad_svg", &result);
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ async fn kcl_test_execute_kittycad_svg() {
|
||||
async fn kcl_test_execute_lsystem() {
|
||||
let code = kcl_input!("lsystem");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("lsystem", &result);
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ async fn kcl_test_execute_lsystem() {
|
||||
async fn kcl_test_member_expression_sketch() {
|
||||
let code = kcl_input!("member_expression_sketch");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("member_expression_sketch", &result);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ async fn kcl_test_member_expression_sketch() {
|
||||
async fn kcl_test_helix_defaults() {
|
||||
let code = kcl_input!("helix_defaults");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("helix_defaults", &result);
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ async fn kcl_test_helix_defaults() {
|
||||
async fn kcl_test_helix_defaults_negative_extrude() {
|
||||
let code = kcl_input!("helix_defaults_negative_extrude");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("helix_defaults_negative_extrude", &result);
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ async fn kcl_test_helix_defaults_negative_extrude() {
|
||||
async fn kcl_test_helix_with_length() {
|
||||
let code = kcl_input!("helix_with_length");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("helix_with_length", &result);
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ async fn kcl_test_helix_with_length() {
|
||||
async fn kcl_test_dimensions_match() {
|
||||
let code = kcl_input!("dimensions_match");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("dimensions_match", &result);
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ async fn kcl_test_dimensions_match() {
|
||||
async fn kcl_test_close_arc() {
|
||||
let code = kcl_input!("close_arc");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("close_arc", &result);
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ async fn kcl_test_close_arc() {
|
||||
async fn kcl_test_negative_args() {
|
||||
let code = kcl_input!("negative_args");
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("negative_args", &result);
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ async fn kcl_test_basic_tangential_arc_with_point() {
|
||||
|> extrude(length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("tangential_arc_with_point", &result);
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ async fn kcl_test_basic_tangential_arc_to() {
|
||||
|> extrude(length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("tangential_arc_to", &result);
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ box(30, 43, 18, '-xy')
|
||||
let thing = box(-12, -15, 10, 'yz')
|
||||
box(-20, -5, 10, 'xy')"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("different_planes_same_drawing", &result);
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ part004 = startSketchOn(YZ)
|
||||
|> close()
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("lots_of_planes", &result);
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ async fn kcl_test_holes() {
|
||||
|> extrude(length = 2)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("holes", &result);
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ async fn optional_params() {
|
||||
|
||||
thing = other_circle([2, 2], 20)
|
||||
"#;
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("optional_params", &result);
|
||||
}
|
||||
|
||||
@ -335,7 +335,7 @@ part = roundedRectangle([0, 0], 20, 20, 4)
|
||||
|> extrude(length = 2)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("rounded_with_holes", &result);
|
||||
}
|
||||
|
||||
@ -343,7 +343,7 @@ part = roundedRectangle([0, 0], 20, 20, 4)
|
||||
async fn kcl_test_top_level_expression() {
|
||||
let code = r#"startSketchOn(XY) |> circle(center = [0,0], radius= 22) |> extrude(length = 14)"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("top_level_expression", &result);
|
||||
}
|
||||
|
||||
@ -357,7 +357,7 @@ part = startSketchOn(XY)
|
||||
|> extrude(length = 1)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_linear_basic_with_math", &result);
|
||||
}
|
||||
|
||||
@ -369,7 +369,7 @@ async fn kcl_test_patterns_linear_basic() {
|
||||
|> extrude(length = 1)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_linear_basic", &result);
|
||||
}
|
||||
|
||||
@ -385,7 +385,7 @@ async fn kcl_test_patterns_linear_basic_3d() {
|
||||
|> patternLinear3d(axis = [1, 0, 1], instances = 4, distance = 6)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_linear_basic_3d", &result);
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ async fn kcl_test_patterns_linear_basic_negative_distance() {
|
||||
|> extrude(length = 1)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_linear_basic_negative_distance", &result);
|
||||
}
|
||||
|
||||
@ -409,7 +409,7 @@ async fn kcl_test_patterns_linear_basic_negative_axis() {
|
||||
|> extrude(length = 1)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_linear_basic_negative_axis", &result);
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ rectangle = startSketchOn(XY)
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_linear_basic_holes", &result);
|
||||
}
|
||||
|
||||
@ -442,7 +442,7 @@ async fn kcl_test_patterns_circular_basic_2d() {
|
||||
|> extrude(length = 1)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_circular_basic_2d", &result);
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ async fn kcl_test_patterns_circular_basic_3d() {
|
||||
|> patternCircular3d(axis = [0,0, 1], center = [-20, -20, -20], instances = 41, arcDegrees = 360, rotateDuplicates = false)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_circular_basic_3d", &result);
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@ async fn kcl_test_patterns_circular_3d_tilted_axis() {
|
||||
|> patternCircular3d(axis = [1,1,0], center = [10, 0, 10], instances = 11, arcDegrees = 360, rotateDuplicates = true)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("patterns_circular_3d_tilted_axis", &result);
|
||||
}
|
||||
|
||||
@ -483,7 +483,7 @@ async fn kcl_test_import_file_doesnt_exist() {
|
||||
let code = r#"import 'thing.obj'
|
||||
model = cube"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -496,7 +496,7 @@ async fn kcl_test_import_obj_with_mtl() {
|
||||
let code = r#"import 'e2e/executor/inputs/cube.obj'
|
||||
model = cube"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("import_obj_with_mtl", &result);
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ async fn kcl_test_import_obj_with_mtl_units() {
|
||||
import 'e2e/executor/inputs/cube.obj'
|
||||
model = cube"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("import_obj_with_mtl_units", &result);
|
||||
}
|
||||
|
||||
@ -515,7 +515,7 @@ async fn kcl_test_import_stl() {
|
||||
let code = r#"import 'e2e/executor/inputs/2-5-long-m8-chc-screw.stl' as screw
|
||||
model = screw"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("import_stl", &result);
|
||||
}
|
||||
|
||||
@ -524,7 +524,7 @@ async fn kcl_test_import_gltf_with_bin() {
|
||||
let code = r#"import 'e2e/executor/inputs/cube.gltf'
|
||||
model = cube"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("import_gltf_with_bin", &result);
|
||||
}
|
||||
|
||||
@ -533,7 +533,7 @@ async fn kcl_test_import_gltf_embedded() {
|
||||
let code = r#"import 'e2e/executor/inputs/cube-embedded.gltf' as cube
|
||||
model = cube"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("import_gltf_embedded", &result);
|
||||
}
|
||||
|
||||
@ -542,7 +542,7 @@ async fn kcl_test_import_glb() {
|
||||
let code = r#"import 'e2e/executor/inputs/cube.glb'
|
||||
model = cube"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("import_glb", &result);
|
||||
}
|
||||
|
||||
@ -551,7 +551,7 @@ async fn kcl_test_import_glb_no_assign() {
|
||||
let code = r#"import 'e2e/executor/inputs/cube.glb'
|
||||
cube"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("import_glb_no_assign", &result);
|
||||
}
|
||||
|
||||
@ -561,7 +561,7 @@ async fn kcl_test_import_ext_doesnt_match() {
|
||||
import 'e2e/executor/inputs/cube.gltf'
|
||||
model = cube"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -586,15 +586,14 @@ async fn kcl_test_cube_mm() {
|
||||
myCube = cube([0,0], 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("cube_mm", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cube_cm() {
|
||||
let code = r#"@settings(defaultLengthUnit = cm)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn('XY')
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
@ -608,15 +607,14 @@ fn cube = (pos, scale) => {
|
||||
myCube = cube([0,0], 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Cm, None).await.unwrap();
|
||||
assert_out("cube_cm", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cube_m() {
|
||||
let code = r#"@settings(defaultLengthUnit = m)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn('XY')
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
@ -630,15 +628,14 @@ fn cube = (pos, scale) => {
|
||||
myCube = cube([0,0], 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::M, None).await.unwrap();
|
||||
assert_out("cube_m", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cube_in() {
|
||||
let code = r#"@settings(defaultLengthUnit = in)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn('XY')
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
@ -652,15 +649,14 @@ fn cube = (pos, scale) => {
|
||||
myCube = cube([0,0], 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::In, None).await.unwrap();
|
||||
assert_out("cube_in", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cube_ft() {
|
||||
let code = r#"@settings(defaultLengthUnit = ft)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn('XY')
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
@ -674,15 +670,14 @@ fn cube = (pos, scale) => {
|
||||
myCube = cube([0,0], 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Ft, None).await.unwrap();
|
||||
assert_out("cube_ft", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_cube_yd() {
|
||||
let code = r#"@settings(defaultLengthUnit = yd)
|
||||
fn cube = (pos, scale) => {
|
||||
sg = startSketchOn('XY')
|
||||
let code = r#"fn cube = (pos, scale) => {
|
||||
sg = startSketchOn(XY)
|
||||
|> startProfileAt(pos, %)
|
||||
|> line(end = [0, scale])
|
||||
|> line(end = [scale, 0])
|
||||
@ -696,7 +691,7 @@ fn cube = (pos, scale) => {
|
||||
myCube = cube([0,0], 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Yd, None).await.unwrap();
|
||||
assert_out("cube_yd", &result);
|
||||
}
|
||||
|
||||
@ -724,7 +719,7 @@ part002 = startSketchOn(part001, part001.sketch.tags.here)
|
||||
|> extrude(length = 1)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
|
||||
let err = result.err().unwrap();
|
||||
let ExecError::Kcl(err) = err else {
|
||||
@ -768,7 +763,7 @@ part003 = startSketchOn(part002, "end")
|
||||
|> extrude(length = 5)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("sketch_on_face_of_face", &result);
|
||||
}
|
||||
|
||||
@ -785,7 +780,7 @@ async fn kcl_test_stdlib_kcl_error_right_code_path() {
|
||||
|> extrude(length = 2)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
let err = result.err().unwrap();
|
||||
let ExecError::Kcl(err) = err else {
|
||||
panic!("Expected KCL error, found {err}");
|
||||
@ -816,7 +811,7 @@ part002 = startSketchOn(part001, "end")
|
||||
|> extrude(length = 5)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("sketch_on_face_circle", &result);
|
||||
}
|
||||
|
||||
@ -842,10 +837,10 @@ holeIndex = 6
|
||||
|
||||
// Create the mounting plate extrusion, holes, and fillets
|
||||
part = rectShape([0, 0], 20, 20)
|
||||
|> hole(circle(XY, [-holeIndex, holeIndex], holeRadius), %)
|
||||
|> hole(circle(XY, [holeIndex, holeIndex], holeRadius), %)
|
||||
|> hole(circle(XY, [-holeIndex, -holeIndex], holeRadius), %)
|
||||
|> hole(circle(XY, [holeIndex, -holeIndex], holeRadius), %)
|
||||
|> hole(circle('XY', center = [-holeIndex, holeIndex], radius = holeRadius), %)
|
||||
|> hole(circle('XY', center = [holeIndex, holeIndex], radius = holeRadius), %)
|
||||
|> hole(circle('XY', center = [-holeIndex, -holeIndex], radius = holeRadius), %)
|
||||
|> hole(circle('XY', center = [holeIndex, -holeIndex], radius = holeRadius), %)
|
||||
|> extrude(length = 2)
|
||||
|> fillet(
|
||||
radius = 4,
|
||||
@ -858,14 +853,14 @@ part = rectShape([0, 0], 20, 20)
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
let err = result.err().unwrap();
|
||||
let ExecError::Kcl(err) = err else {
|
||||
panic!("Expected KCL error, found {err}");
|
||||
};
|
||||
assert_eq!(
|
||||
err.error.message(),
|
||||
"This function requires a keyword argument 'center'"
|
||||
"The input argument of std::sketch::circle requires a value with type `Sketch | Plane | Face`, but found string (text)"
|
||||
);
|
||||
}
|
||||
|
||||
@ -885,7 +880,7 @@ async fn kcl_test_simple_revolve() {
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("simple_revolve", &result);
|
||||
}
|
||||
|
||||
@ -905,7 +900,7 @@ async fn kcl_test_simple_revolve_uppercase() {
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("simple_revolve_uppercase", &result);
|
||||
}
|
||||
|
||||
@ -925,7 +920,7 @@ async fn kcl_test_simple_revolve_negative() {
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("simple_revolve_negative", &result);
|
||||
}
|
||||
|
||||
@ -945,7 +940,7 @@ async fn kcl_test_revolve_bad_angle_low() {
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
|
||||
assert!(result.is_err());
|
||||
assert!(result
|
||||
@ -971,7 +966,7 @@ async fn kcl_test_revolve_bad_angle_high() {
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
|
||||
assert!(result.is_err());
|
||||
assert!(result
|
||||
@ -997,7 +992,7 @@ async fn kcl_test_simple_revolve_custom_angle() {
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("simple_revolve_custom_angle", &result);
|
||||
}
|
||||
|
||||
@ -1017,7 +1012,7 @@ async fn kcl_test_simple_revolve_custom_axis() {
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("simple_revolve_custom_axis", &result);
|
||||
}
|
||||
|
||||
@ -1041,7 +1036,7 @@ sketch001 = startSketchOn(box, "end")
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("revolve_on_edge", &result);
|
||||
}
|
||||
|
||||
@ -1065,7 +1060,7 @@ sketch001 = startSketchOn(box, revolveAxis)
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
|
||||
result.unwrap_err();
|
||||
//this fails right now, but slightly differently, lets just say its enough for it to fail - mike
|
||||
@ -1093,7 +1088,7 @@ sketch001 = startSketchOn(box, "END")
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("revolve_on_face_circle_edge", &result);
|
||||
}
|
||||
|
||||
@ -1115,7 +1110,7 @@ sketch001 = startSketchOn(box, "END")
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("revolve_on_face_circle", &result);
|
||||
}
|
||||
|
||||
@ -1141,7 +1136,7 @@ sketch001 = startSketchOn(box, "end")
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("revolve_on_face", &result);
|
||||
}
|
||||
|
||||
@ -1155,7 +1150,7 @@ async fn kcl_test_basic_revolve_circle() {
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("basic_revolve_circle", &result);
|
||||
}
|
||||
|
||||
@ -1182,7 +1177,7 @@ part002 = startSketchOn(part001, 'end')
|
||||
|> extrude(length = 5)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("simple_revolve_sketch_on_edge", &result);
|
||||
}
|
||||
|
||||
@ -1245,7 +1240,7 @@ plumbus1 = circle1
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("plumbus_fillets", &result);
|
||||
}
|
||||
|
||||
@ -1253,7 +1248,7 @@ plumbus1 = circle1
|
||||
async fn kcl_test_empty_file_is_ok() {
|
||||
let code = r#""#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
result.unwrap();
|
||||
}
|
||||
|
||||
@ -1283,7 +1278,7 @@ async fn kcl_test_member_expression_in_params() {
|
||||
capScrew([0, 0.5, 0], 50, 37.5, 50, 25)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("member_expression_in_params", &result);
|
||||
}
|
||||
|
||||
@ -1328,7 +1323,7 @@ bracket = startSketchOn(XY)
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
result.unwrap();
|
||||
}
|
||||
|
||||
@ -1348,11 +1343,11 @@ secondSketch = startSketchOn(part001, '')
|
||||
|> extrude(length = 20)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([297, 299, 0])], message: "Argument at index 1 was supposed to be type Option<kcl_lib::std::sketch::FaceTag> but found string (text)" }"#
|
||||
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([297, 299, 0])], message: "Argument at index 1 was supposed to be type Option<FaceTag> but found string (text)" }"#
|
||||
);
|
||||
}
|
||||
|
||||
@ -1379,7 +1374,7 @@ extrusion = startSketchOn(XY)
|
||||
|> extrude(length = height)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1412,7 +1407,7 @@ sketch001 = [profile001, profile002]
|
||||
extrude(sketch001, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("array_of_sketches", &result);
|
||||
}
|
||||
|
||||
@ -1449,7 +1444,7 @@ pattn1 = patternLinear3d(
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("pattern3d_array_of_extrudes", &result);
|
||||
}
|
||||
|
||||
@ -1497,7 +1492,7 @@ baseExtrusion = extrude(sketch001, length = width)
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("fillets_referencing_other_fillets", &result);
|
||||
}
|
||||
|
||||
@ -1545,7 +1540,7 @@ baseExtrusion = extrude(sketch001, length = width)
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("chamfers_referencing_other_chamfers", &result);
|
||||
}
|
||||
|
||||
@ -1565,7 +1560,7 @@ async fn kcl_test_shell_with_tag() {
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("shell_with_tag", &result);
|
||||
}
|
||||
|
||||
@ -1596,7 +1591,7 @@ pattn1 = patternLinear3d(
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("linear_pattern3d_filleted_sketch", &result);
|
||||
}
|
||||
|
||||
@ -1623,7 +1618,7 @@ pattn2 = patternCircular3d(part001, axis = [0,0, 1], center = [-20, -20, -20], i
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("circular_pattern3d_filleted_sketch", &result);
|
||||
}
|
||||
|
||||
@ -1649,7 +1644,7 @@ part001 = cube([0,0], 20)
|
||||
pattn2 = patternCircular3d(part001, axis = [0,0, 1], center = [-20, -20, -20], instances = 5, arcDegrees = 360, rotateDuplicates = false)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("circular_pattern3d_chamfered_sketch", &result);
|
||||
}
|
||||
|
||||
@ -1676,7 +1671,7 @@ part001 = cube([0,0], 20)
|
||||
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
let err = result.err().unwrap();
|
||||
let ExecError::Kcl(err) = err else {
|
||||
panic!("Expected KCL error, found {err}");
|
||||
@ -1706,7 +1701,7 @@ async fn kcl_test_duplicate_tags_should_error() {
|
||||
let p = triangle(200)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1717,49 +1712,49 @@ let p = triangle(200)
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_global_tags() {
|
||||
let code = kcl_input!("global-tags");
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("global_tags", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_extrude_inside_fn_with_tags() {
|
||||
let code = kcl_input!("extrude-inside-fn-with-tags");
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("extrude-inside-fn-with-tags", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_pattern_vase() {
|
||||
let code = kcl_input!("pattern_vase");
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("pattern_vase", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_scoped_tags() {
|
||||
let code = kcl_input!("scoped-tags");
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("scoped_tags", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_order_sketch_extrude_in_order() {
|
||||
let code = kcl_input!("order-sketch-extrude-in-order");
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("order-sketch-extrude-in-order", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_order_sketch_extrude_out_of_order() {
|
||||
let code = kcl_input!("order-sketch-extrude-out-of-order");
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("order-sketch-extrude-out-of-order", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_extrude_custom_plane() {
|
||||
let code = kcl_input!("extrude-custom-plane");
|
||||
let result = execute_and_snapshot(code, None).await.unwrap();
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await.unwrap();
|
||||
assert_out("extrude-custom-plane", &result);
|
||||
}
|
||||
|
||||
@ -1781,7 +1776,7 @@ async fn kcl_test_arc_error_same_start_end() {
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1801,7 +1796,7 @@ async fn kcl_test_angled_line_to_x_90() {
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1821,7 +1816,7 @@ async fn kcl_test_angled_line_to_x_270() {
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1841,7 +1836,7 @@ async fn kcl_test_angled_line_to_y_0() {
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1861,7 +1856,7 @@ async fn kcl_test_angled_line_to_y_180() {
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1881,7 +1876,7 @@ async fn kcl_test_angled_line_of_x_length_90() {
|
||||
extrusion = extrude(sketch001, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1901,7 +1896,7 @@ async fn kcl_test_angled_line_of_x_length_270() {
|
||||
extrusion = extrude(sketch001, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1923,7 +1918,7 @@ async fn kcl_test_angled_line_of_y_length_0() {
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1945,7 +1940,7 @@ async fn kcl_test_angled_line_of_y_length_180() {
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1967,7 +1962,7 @@ async fn kcl_test_angled_line_of_y_length_negative_180() {
|
||||
example = extrude(exampleSketch, length = 10)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
@ -1984,11 +1979,11 @@ async fn kcl_test_error_inside_fn_also_has_source_range_of_call_site() {
|
||||
someFunction('INVALID')
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([51, 60, 0]), SourceRange([65, 88, 0])], message: "Argument at index 0 was supposed to be type kcl_lib::std::sketch::SketchData but found string (text)" }"#
|
||||
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([51, 60, 0]), SourceRange([65, 88, 0])], message: "Argument at index 0 was supposed to be type SketchData but found string (text)" }"#
|
||||
);
|
||||
}
|
||||
|
||||
@ -2005,11 +2000,11 @@ async fn kcl_test_error_inside_fn_also_has_source_range_of_call_site_recursive()
|
||||
someFunction('INVALID')
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert_eq!(
|
||||
result.err().unwrap().to_string(),
|
||||
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([103, 113, 0]), SourceRange([126, 155, 0]), SourceRange([159, 182, 0])], message: "Argument at index 0 was supposed to be type kcl_lib::std::sketch::SketchData but found string (text)" }"#
|
||||
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([103, 113, 0]), SourceRange([126, 155, 0]), SourceRange([159, 182, 0])], message: "Argument at index 0 was supposed to be type SketchData but found string (text)" }"#
|
||||
);
|
||||
}
|
||||
|
||||
@ -2029,7 +2024,7 @@ async fn kcl_test_error_no_auth_websocket() {
|
||||
)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot_no_auth(code, None).await;
|
||||
let result = execute_and_snapshot_no_auth(code, UnitLength::Mm, None).await;
|
||||
assert!(result.is_err());
|
||||
assert!(result
|
||||
.err()
|
||||
@ -2055,7 +2050,9 @@ sketch000 = startSketchOn(XY)
|
||||
|> line(end = [0, innerDiameter / 2])
|
||||
"#;
|
||||
|
||||
let ctx = kcl_lib::ExecutorContext::new_with_default_client().await.unwrap();
|
||||
let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default())
|
||||
.await
|
||||
.unwrap();
|
||||
let mut exec_state = kcl_lib::ExecState::new(&ctx);
|
||||
let program = kcl_lib::Program::parse_no_errs(code).unwrap();
|
||||
ctx.run(&program, &mut exec_state).await.unwrap();
|
||||
@ -2078,7 +2075,9 @@ async fn kcl_test_ensure_nothing_left_in_batch_multi_file() {
|
||||
// Change the current working directory to the test directory.
|
||||
std::env::set_current_dir(path.parent().unwrap()).unwrap();
|
||||
|
||||
let ctx = kcl_lib::ExecutorContext::new_with_default_client().await.unwrap();
|
||||
let ctx = kcl_lib::ExecutorContext::new_with_default_client(Default::default())
|
||||
.await
|
||||
.unwrap();
|
||||
let mut exec_state = kcl_lib::ExecState::new(&ctx);
|
||||
let program = kcl_lib::Program::parse_no_errs(&code).unwrap();
|
||||
ctx.run(&program, &mut exec_state).await.unwrap();
|
||||
@ -2096,7 +2095,7 @@ async fn kcl_test_better_type_names() {
|
||||
|> circle(center = [-95.51, -74.7], radius = 262.23)
|
||||
|> appearance(metalness = 0.9)
|
||||
"#;
|
||||
let result = execute_and_snapshot(code, None).await;
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm, None).await;
|
||||
|
||||
let err = match result.err() {
|
||||
Some(x) => match x {
|
||||
@ -2115,7 +2114,7 @@ async fn kcl_test_exporting_step_file() {
|
||||
// This tests export like how we do it in cli and kcl.py.
|
||||
let code = kcl_input!("helix_defaults_negative_extrude");
|
||||
|
||||
let (_, _, files) = execute_and_export_step(code, None).await.unwrap();
|
||||
let (_, _, files) = execute_and_export_step(code, UnitLength::Mm, None).await.unwrap();
|
||||
for file in files {
|
||||
expectorate::assert_contents(
|
||||
format!("e2e/executor/outputs/helix_defaults_negative_extrude_{}", file.name),
|
||||
|