summaryrefslogtreecommitdiff
path: root/tests/features/test_destructuring.zc
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-25 15:12:12 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-25 15:12:12 +0000
commit7d1944ab9d2307f2736afe8520436872db1c7617 (patch)
tree7380a4f148f9ce0b70ed9f02cfa5e8561c783a7a /tests/features/test_destructuring.zc
parent8b720543f538862796fec0ff6b7ea12cb140bf0f (diff)
'let' it be
Diffstat (limited to 'tests/features/test_destructuring.zc')
-rw-r--r--tests/features/test_destructuring.zc10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/features/test_destructuring.zc b/tests/features/test_destructuring.zc
index b898582..3e24001 100644
--- a/tests/features/test_destructuring.zc
+++ b/tests/features/test_destructuring.zc
@@ -13,24 +13,24 @@ fn tuple_ret() -> (int, int) {
}
test "test_destructuring" {
- var p = Point{x: 1, y: 2};
+ let p = Point{x: 1, y: 2};
// Explicit Struct Destructuring (Shorthand)
- var Point{x, y} = p;
+ let Point{x, y} = p;
assert(x == 1, "x is 1");
assert(y == 2, "y is 2");
// Explicit Struct Destructuring (Renamed)
- var Point{x: a, y: b} = p;
+ let Point{x: a, y: b} = p;
assert(a == 1, "a is 1");
assert(b == 2, "b is 2");
// Anonymous Struct Destructuring (Inferred)
// Note: Anonymous block only supports shorthand {x, y} currently.
- // var {x: x2} = p; // Not supported yet in anonymous block parser
+ // let {x: x2} = p; // Not supported yet in anonymous block parser
// Tuple Destructuring
- var (t1, t2) = tuple_ret();
+ let (t1, t2) = tuple_ret();
assert(t1 == 10, "t1 is 10");
assert(t2 == 20, "t2 is 20");