2024-11-18 16:20:32 -06:00
|
|
|
// This tests computed properties.
|
|
|
|
|
|
|
|
|
|
|
|
arr = [0, 0, 0, 10]
|
|
|
|
i = 3
|
|
|
|
ten = arr[i]
|
|
|
|
|
2025-04-22 12:44:52 -05:00
|
|
|
assert(ten, isEqualTo = 10, error = "oops")
|
2024-11-18 16:20:32 -06:00
|
|
|
|
2024-11-25 09:21:55 +13:00
|
|
|
obj = { foo = 1, bar = 0 }
|
2025-04-28 12:08:47 -04:00
|
|
|
one = obj.foo
|
2024-11-18 16:20:32 -06:00
|
|
|
|
2025-04-22 12:44:52 -05:00
|
|
|
assert(one, isEqualTo = 1, error = "oops")
|
|
|
|
|
|
|
|
assert(PI, isEqualTo = 3, tolerance = 0.2, error = "oops pi")
|
2025-02-20 19:33:21 +13:00
|
|
|
|
2025-04-30 11:07:05 -04:00
|
|
|
x = cos((2 * PI): number(rad))
|
2025-04-22 12:44:52 -05:00
|
|
|
assert(x, isEqualTo = 1, tolerance = 0.000001, error = "oops cos")
|