feat: add string_zero_pad

This commit is contained in:
theoludwig committed 2024-09-12 12:31:58 +02:00
1 parent 35b868d0c1
commit c49d5f5421
4 files changed
+34

No files matched your search

+11
View File
@@ -28,6 +28,7 @@ void string_test() {
string_position_of_test();
string_last_position_of_test();
string_pad_start_test();
string_zero_pad_test();
}
void string_get_length_test() {
@@ -322,3 +323,13 @@ void string_pad_start_test() {
assert(assert_string_equal(result, "ahello"));
free(result);
}
void string_zero_pad_test() {
string_t result = string_zero_pad(1, 2);
assert(assert_string_equal(result, "01"));
free(result);
result = string_zero_pad(10, 2);
assert(assert_string_equal(result, "10"));
free(result);
}
+2
View File
@@ -64,4 +64,6 @@ void string_last_position_of_test();
void string_pad_start_test();
void string_zero_pad_test();
#endif