- Test runner will also check for leaks.

- `write` of qoi would leak memory.
- Issue when having an empty `Path` or just "."
- `set_env` would leak memory.
This commit is contained in:
Christoffer Lerno
2025-02-10 00:39:02 +01:00
parent 63f619e5b6
commit c4212c4649
20 changed files with 81 additions and 41 deletions

View File

@@ -7,6 +7,7 @@ fn void copy_map() @test
{
TrackingAllocator alloc;
alloc.init(allocator::heap());
defer alloc.free();
assert(alloc.allocated() == 0);
mem::@scoped(&alloc)
{
@@ -39,7 +40,8 @@ fn void copy_map() @test
fn void copy_keys() @test
{
String[] y;
@pool() {
@pool()
{
IntMap x;
x.temp_init();
x.set("hello", 0); // keys copied into temp hashmap
@@ -47,4 +49,6 @@ fn void copy_keys() @test
// end of pool: hashmap and its copied-in keys dropped
};
assert(y == {"hello"});
foreach(key : y) free(key);
free(y);
}