- 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

@@ -103,10 +103,12 @@ fn void test_split()
assert(strings[2] == "");
assert(strings[3] == "c");
assert(strings[4] == "");
free(strings);
strings = test.split("|", 2);
assert(strings.len == 2);
assert(strings[0] == "abc");
assert(strings[1] == "b||c|");
free(strings);
}
fn void test_split_skip_empty()
@@ -117,10 +119,12 @@ fn void test_split_skip_empty()
assert(strings[0] == "abc");
assert(strings[1] == "b");
assert(strings[2] == "c");
free(strings);
strings = test.split("|", 2, skip_empty: true);
assert(strings.len == 2);
assert(strings[0] == "abc");
assert(strings[1] == "b||c|");
free(strings);
}
fn void test_split_to_buffer_skip_empty()
@@ -136,6 +140,7 @@ fn void test_split_to_buffer_skip_empty()
assert(strings.len == 2);
assert(strings[0] == "abc");
assert(strings[1] == "b||c|");
free(strings);
}
fn void test_split_to_buffer()
@@ -155,6 +160,7 @@ fn void test_split_to_buffer()
assert(strings.len == 2);
assert(strings[0] == "abc");
assert(strings[1] == "b||c|");
free(strings);
}
fn void test_index_of()