mirror of
https://github.com/theoludwig/libcproject.git
synced 2025-05-21 23:21:15 +02:00
feat: add string_zero_pad
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -64,4 +64,6 @@ void string_last_position_of_test();
|
||||
|
||||
void string_pad_start_test();
|
||||
|
||||
void string_zero_pad_test();
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user