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 array_range_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_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_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_expr.kcl
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"range": [],
|
||||
"command": {
|
||||
"type": "object_visible",
|
||||
"object_id": "[uuid]",
|
||||
|
File diff suppressed because it is too large
Load Diff
21
rust/kcl-lib/tests/array_range_expr/unparsed.snap
Normal file
21
rust/kcl-lib/tests/array_range_expr/unparsed.snap
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing array_range_expr.kcl
|
||||
---
|
||||
r1 = [0..4]
|
||||
assertEqual(r1[4], 4, 0.00001, "last element is included")
|
||||
|
||||
four = 4
|
||||
zero = 0
|
||||
r2 = [zero..four]
|
||||
assertEqual(r2[4], 4, 0.00001, "last element is included")
|
||||
|
||||
five = int(four + 1)
|
||||
r3 = [zero..five]
|
||||
assertEqual(r3[4], 4, 0.00001, "second-to-last element is included")
|
||||
assertEqual(r3[5], 5, 0.00001, "last element is included")
|
||||
|
||||
r4 = [int(zero + 1) .. int(five - 1)]
|
||||
assertEqual(r4[0], 1, 0.00001, "first element is 1")
|
||||
assertEqual(r4[2], 3, 0.00001, "second-to-last element is 3")
|
||||
assertEqual(r4[3], 4, 0.00001, "last element is 4")
|
Reference in New Issue
Block a user