summaryrefslogtreecommitdiff
path: root/tests/features/test_destructuring.zc
diff options
context:
space:
mode:
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");