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:
@ -5,11 +5,7 @@ description: Artifact commands import_cycle1.kcl
|
||||
[
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "edge_lines_visible",
|
||||
"hidden": false
|
||||
@ -17,11 +13,7 @@ description: Artifact commands import_cycle1.kcl
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "set_scene_units",
|
||||
"unit": "mm"
|
||||
@ -29,11 +21,7 @@ description: Artifact commands import_cycle1.kcl
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
@ -42,11 +30,7 @@ description: Artifact commands import_cycle1.kcl
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of parsing import_cycle1.kcl
|
||||
---
|
||||
{
|
||||
"Ok": {
|
||||
"body": [
|
||||
{
|
||||
"end": 69,
|
||||
"end": 0,
|
||||
"path": {
|
||||
"type": "Kcl",
|
||||
"filename": "import_cycle2.kcl"
|
||||
@ -16,29 +16,29 @@ description: Result of parsing import_cycle1.kcl
|
||||
"items": [
|
||||
{
|
||||
"alias": null,
|
||||
"end": 44,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"end": 44,
|
||||
"end": 0,
|
||||
"name": "two",
|
||||
"start": 41,
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"start": 41,
|
||||
"start": 0,
|
||||
"type": "ImportItem"
|
||||
}
|
||||
]
|
||||
},
|
||||
"start": 34,
|
||||
"start": 0,
|
||||
"type": "ImportStatement",
|
||||
"type": "ImportStatement"
|
||||
},
|
||||
{
|
||||
"declaration": {
|
||||
"end": 109,
|
||||
"end": 0,
|
||||
"id": {
|
||||
"end": 84,
|
||||
"end": 0,
|
||||
"name": "one",
|
||||
"start": 81,
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
@ -46,25 +46,25 @@ description: Result of parsing import_cycle1.kcl
|
||||
"body": [
|
||||
{
|
||||
"argument": {
|
||||
"end": 107,
|
||||
"end": 0,
|
||||
"left": {
|
||||
"arguments": [],
|
||||
"callee": {
|
||||
"end": 101,
|
||||
"end": 0,
|
||||
"name": "two",
|
||||
"start": 98,
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 103,
|
||||
"start": 98,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
},
|
||||
"operator": "-",
|
||||
"right": {
|
||||
"end": 107,
|
||||
"end": 0,
|
||||
"raw": "1",
|
||||
"start": 106,
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
@ -72,61 +72,61 @@ description: Result of parsing import_cycle1.kcl
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"start": 98,
|
||||
"start": 0,
|
||||
"type": "BinaryExpression",
|
||||
"type": "BinaryExpression"
|
||||
},
|
||||
"end": 107,
|
||||
"start": 91,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "ReturnStatement",
|
||||
"type": "ReturnStatement"
|
||||
}
|
||||
],
|
||||
"end": 109,
|
||||
"start": 87
|
||||
"end": 0,
|
||||
"start": 0
|
||||
},
|
||||
"end": 109,
|
||||
"end": 0,
|
||||
"params": [],
|
||||
"start": 84,
|
||||
"start": 0,
|
||||
"type": "FunctionExpression",
|
||||
"type": "FunctionExpression"
|
||||
},
|
||||
"start": 81,
|
||||
"start": 0,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 109,
|
||||
"end": 0,
|
||||
"kind": "fn",
|
||||
"start": 71,
|
||||
"start": 0,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"visibility": "export"
|
||||
}
|
||||
],
|
||||
"end": 110,
|
||||
"end": 0,
|
||||
"innerAttrs": [
|
||||
{
|
||||
"end": 33,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"end": 9,
|
||||
"end": 0,
|
||||
"name": "settings",
|
||||
"start": 1,
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"end": 32,
|
||||
"end": 0,
|
||||
"key": {
|
||||
"end": 27,
|
||||
"end": 0,
|
||||
"name": "defaultLengthUnit",
|
||||
"start": 10,
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"start": 10,
|
||||
"start": 0,
|
||||
"type": "ObjectProperty",
|
||||
"value": {
|
||||
"end": 32,
|
||||
"end": 0,
|
||||
"name": "in",
|
||||
"start": 30,
|
||||
"start": 0,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
}
|
||||
@ -140,8 +140,8 @@ description: Result of parsing import_cycle1.kcl
|
||||
"nonCodeNodes": {
|
||||
"0": [
|
||||
{
|
||||
"end": 71,
|
||||
"start": 69,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "NonCodeNode",
|
||||
"value": {
|
||||
"type": "newLine"
|
||||
|
||||
10
rust/kcl-lib/tests/import_cycle1/unparsed.snap
Normal file
10
rust/kcl-lib/tests/import_cycle1/unparsed.snap
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing import_cycle1.kcl
|
||||
---
|
||||
@settings(defaultLengthUnit = in)
|
||||
import two from "import_cycle2.kcl"
|
||||
|
||||
export fn one() {
|
||||
return two() - 1
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing tests/import_cycle1/import_cycle2.kcl
|
||||
---
|
||||
@settings(defaultLengthUnit = mm)
|
||||
import three from "import_cycle3.kcl"
|
||||
|
||||
export fn two() {
|
||||
return three() - 1
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing tests/import_cycle1/import_cycle3.kcl
|
||||
---
|
||||
@settings(defaultLengthUnit = in)
|
||||
import one from "input.kcl"
|
||||
|
||||
export fn three() {
|
||||
return one() + one() + one()
|
||||
}
|
||||
Reference in New Issue
Block a user