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 array_range_negative_expr.kcl
[
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "edge_lines_visible",
"hidden": false
@ -17,11 +13,7 @@ description: Artifact commands array_range_negative_expr.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "set_scene_units",
"unit": "mm"
@ -29,11 +21,7 @@ description: Artifact commands array_range_negative_expr.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
@ -42,11 +30,7 @@ description: Artifact commands array_range_negative_expr.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing array_range_negative_expr.kcl
---
{
@ -7,19 +7,19 @@ description: Result of parsing array_range_negative_expr.kcl
"body": [
{
"declaration": {
"end": 19,
"end": 0,
"id": {
"end": 2,
"end": 0,
"name": "xs",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 19,
"end": 0,
"endElement": {
"end": 18,
"end": 0,
"raw": "5",
"start": 17,
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
@ -28,14 +28,14 @@ description: Result of parsing array_range_negative_expr.kcl
}
},
"endInclusive": true,
"start": 5,
"start": 0,
"startElement": {
"arguments": [
{
"argument": {
"end": 12,
"end": 0,
"raw": "5",
"start": 11,
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
@ -43,21 +43,21 @@ description: Result of parsing array_range_negative_expr.kcl
"suffix": "None"
}
},
"end": 12,
"end": 0,
"operator": "-",
"start": 10,
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"callee": {
"end": 9,
"end": 0,
"name": "int",
"start": 6,
"start": 0,
"type": "Identifier"
},
"end": 13,
"start": 6,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
@ -67,30 +67,30 @@ description: Result of parsing array_range_negative_expr.kcl
"start": 0,
"type": "VariableDeclarator"
},
"end": 19,
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 72,
"end": 0,
"expression": {
"arguments": [
{
"computed": false,
"end": 37,
"end": 0,
"object": {
"end": 34,
"end": 0,
"name": "xs",
"start": 32,
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"end": 36,
"end": 0,
"raw": "0",
"start": 35,
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
@ -98,15 +98,15 @@ description: Result of parsing array_range_negative_expr.kcl
"suffix": "None"
}
},
"start": 32,
"start": 0,
"type": "MemberExpression",
"type": "MemberExpression"
},
{
"argument": {
"end": 41,
"end": 0,
"raw": "5",
"start": 40,
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
@ -114,16 +114,16 @@ description: Result of parsing array_range_negative_expr.kcl
"suffix": "None"
}
},
"end": 41,
"end": 0,
"operator": "-",
"start": 39,
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"end": 48,
"end": 0,
"raw": "0.001",
"start": 43,
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
@ -132,31 +132,31 @@ description: Result of parsing array_range_negative_expr.kcl
}
},
{
"end": 71,
"end": 0,
"raw": "\"first element is -5\"",
"start": 50,
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "first element is -5"
}
],
"callee": {
"end": 31,
"end": 0,
"name": "assertEqual",
"start": 20,
"start": 0,
"type": "Identifier"
},
"end": 72,
"start": 20,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 20,
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 73,
"end": 0,
"start": 0
}
}

View File

@ -0,0 +1,6 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing array_range_negative_expr.kcl
---
xs = [int(-5) .. 5]
assertEqual(xs[0], -5, 0.001, "first element is -5")