add vec_grow_to

This commit is contained in:
2025-02-26 16:03:55 -08:00
parent f9a9f82a95
commit 9d03411979
3 changed files with 26 additions and 8 deletions

View File

@ -271,6 +271,10 @@ void test_vector() {
printf("\ncap after clear: %zu\n", vec_cap(v));
printf("len after clear: %zu\n", vec_len(v));
vec_grow_to(v, 10);
assert(vec_cap(v) == 10);
assert(vec_len(v) == 0);
vec_destroy(v);
free(v);
}