summaryrefslogtreecommitdiff
path: root/tests/memory/test_move_double_free.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/memory/test_move_double_free.zc
parent8b720543f538862796fec0ff6b7ea12cb140bf0f (diff)
'let' it be
Diffstat (limited to 'tests/memory/test_move_double_free.zc')
-rw-r--r--tests/memory/test_move_double_free.zc16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/memory/test_move_double_free.zc b/tests/memory/test_move_double_free.zc
index 8322bcd..74a794c 100644
--- a/tests/memory/test_move_double_free.zc
+++ b/tests/memory/test_move_double_free.zc
@@ -1,8 +1,8 @@
import "../../std/mem.zc"
// Global counters to track drop calls
-var DROP_COUNT = 0;
-var DROP_NULL_COUNT = 0;
+let DROP_COUNT = 0;
+let DROP_NULL_COUNT = 0;
struct Resource {
data: int*;
@@ -32,8 +32,8 @@ test "move_variable" {
DROP_NULL_COUNT = 0;
{
- var r1 = Resource { data: malloc(10), id: 1 };
- var r2 = r1; // Move
+ let r1 = Resource { data: malloc(10), id: 1 };
+ let r2 = r1; // Move
// r1 should be nullified
// r2 owns data
@@ -52,8 +52,8 @@ test "move_function" {
DROP_NULL_COUNT = 0;
{
- var r1 = Resource { data: malloc(10), id: 2 };
- var r2 = pass_through(r1);
+ let r1 = Resource { data: malloc(10), id: 2 };
+ let r2 = pass_through(r1);
// r1 moved to arg -> moved to return -> moved to r2
}
@@ -73,8 +73,8 @@ test "partial_move_member" {
DROP_NULL_COUNT = 0;
{
- var c = Container { res: Resource { data: malloc(10), id: 3 } };
- var r = c.res; // Partial move
+ let c = Container { res: Resource { data: malloc(10), id: 3 } };
+ let r = c.res; // Partial move
// c.res should be nullified
// r owns data