Improve snapshot testing (#5856)

* Improve snapshot testing

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Nick Cameron
2025-03-20 11:06:27 +13:00
committed by GitHub
parent 4b6166dc4f
commit a7e09a89ef
551 changed files with 115788 additions and 275855 deletions

View File

@ -5,11 +5,7 @@ description: Artifact commands cube_with_error.kcl
[
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "edge_lines_visible",
"hidden": false
@ -17,11 +13,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "set_scene_units",
"unit": "mm"
@ -29,11 +21,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
@ -42,11 +30,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
@ -55,11 +39,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
177,
194,
0
],
"range": [],
"command": {
"type": "make_plane",
"origin": {
@ -84,11 +64,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
202,
223,
0
],
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
@ -104,22 +80,14 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
202,
223,
0
],
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [
202,
223,
0
],
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
@ -132,22 +100,14 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
202,
223,
0
],
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
253,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -164,11 +124,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
261,
283,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -185,11 +141,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
291,
313,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -206,11 +158,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
321,
343,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -227,11 +175,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
351,
358,
0
],
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
@ -239,11 +183,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
366,
390,
0
],
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
@ -259,11 +199,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
366,
390,
0
],
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
@ -273,22 +209,14 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
366,
390,
0
],
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
366,
390,
0
],
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
@ -296,11 +224,7 @@ description: Artifact commands cube_with_error.kcl
},
{
"cmdId": "[uuid]",
"range": [
366,
390,
0
],
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",

File diff suppressed because it is too large Load Diff

View File

@ -13,11 +13,7 @@ description: Operations executed cube_with_error.kcl
],
"unlabeledArg": null,
"labeledArgs": {},
"sourceRange": [
403,
419,
0
]
"sourceRange": []
},
{
"labeledArgs": {
@ -26,19 +22,11 @@ description: Operations executed cube_with_error.kcl
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": [
191,
193,
0
]
"sourceRange": []
}
},
"name": "startSketchOn",
"sourceRange": [
177,
194,
0
],
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": null
},
@ -58,19 +46,11 @@ description: Operations executed cube_with_error.kcl
}
}
},
"sourceRange": [
383,
389,
0
]
"sourceRange": []
}
},
"name": "extrude",
"sourceRange": [
366,
390,
0
],
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
@ -79,11 +59,7 @@ description: Operations executed cube_with_error.kcl
"artifactId": "[uuid]"
}
},
"sourceRange": [
366,
390,
0
]
"sourceRange": []
}
},
{

View File

@ -0,0 +1,27 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing cube_with_error.kcl
---
fn cube(length, center) {
l = length / 2
x = center[0]
y = center[1]
p0 = [-l + x, -l + y]
p1 = [-l + x, l + y]
p2 = [l + x, l + y]
p3 = [l + x, -l + y]
return startSketchOn(XY)
|> startProfileAt(p0, %)
|> line(endAbsolute = p1)
|> line(endAbsolute = p2)
|> line(endAbsolute = p3)
|> line(endAbsolute = p0)
|> close()
|> extrude(length = length)
}
myCube = cube(40, [0, 0])
// Error, after creating meaningful output.
foo