add vec_clear

This commit is contained in:
2025-02-26 15:32:19 -08:00
parent ba6e929b4f
commit 1140486c83
3 changed files with 18 additions and 1 deletions

View File

@ -268,6 +268,11 @@ void test_vector() {
assert(vec_len(v) == vec_cap(v));
printf("cap after shrink: %zu\n", vec_cap(v));
vec_clear(v);
assert(vec_len(v) == 0);
printf("\ncap after clear: %zu\n", vec_cap(v));
printf("len after clear: %zu\n", vec_len(v));
vec_destroy(v);
free(v);
}