Files
modeling-app/rust/kcl-lib/tests/computed_var/input.kcl
Jonathan Tran 2e754f2a11 BREAKING: Change to disallow indexing KCL records/objects with strings (#6529)
* Change to disallow indexing records/objects with strings

* Update output

* Remove outdated sim test

* Fix tests
2025-04-28 12:08:47 -04:00

19 lines
354 B
Plaintext

// This tests computed properties.
arr = [0, 0, 0, 10]
i = 3
ten = arr[i]
assert(ten, isEqualTo = 10, error = "oops")
obj = { foo = 1, bar = 0 }
one = obj.foo
assert(one, isEqualTo = 1, error = "oops")
assert(PI, isEqualTo = 3, tolerance = 0.2, error = "oops pi")
x = cos(2 * PI)
assert(x, isEqualTo = 1, tolerance = 0.000001, error = "oops cos")