parse const decls

This commit is contained in:
2026-07-25 00:26:47 +02:00
parent c7f527e3c3
commit 90c7195d4b
28 changed files with 1452 additions and 1134 deletions
+15 -15
View File
@@ -2,31 +2,31 @@ import "@std/mem"
import "@std/testing"
handles_append test {
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
try append(&list, 42)
try append(&list, 42)
try testing.expect_equal(1, list.items.len)
try testing.expect_equal(42, list.items[0])
try testing.expect_equal(1, list.items.len)
try testing.expect_equal(42, list.items[0])
}
handles_clear test {
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
try append(&list, 42)
clear(&list)
try append(&list, 42)
clear(&list)
try testing.expect_equal(0, list.items.len)
try testing.expect_equal(0, list.items.len)
}
handles_reserve test {
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
try reserve(&list, 10)
try reserve(&list, 10)
try testing.expect_equal(10, list.capacity)
try testing.expect_equal(0, list.items.len)
try testing.expect_equal(10, list.capacity)
try testing.expect_equal(0, list.items.len)
}