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:
25
rust/kcl-lib/tests/index_of_array/unparsed.snap
Normal file
25
rust/kcl-lib/tests/index_of_array/unparsed.snap
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of unparsing index_of_array.kcl
|
||||
---
|
||||
// This tests indexing an array.
|
||||
|
||||
|
||||
arr = [90, 91, 92]
|
||||
|
||||
// Test: literal index.
|
||||
|
||||
|
||||
result0 = arr[1]
|
||||
|
||||
assertLessThanOrEq(result0, 91, "Literal property lookup")
|
||||
assertGreaterThanOrEq(result0, 91, "Literal property lookup")
|
||||
|
||||
// Test: computed index.
|
||||
|
||||
|
||||
i = int(1 + 0)
|
||||
result1 = arr[i]
|
||||
|
||||
assertLessThanOrEq(result1, 91, "Computed property lookup")
|
||||
assertGreaterThanOrEq(result1, 91, "Computed property lookup")
|
||||
Reference in New Issue
Block a user