Add test for wapp_str8_format
This commit is contained in:
parent
80bd68f313
commit
01f066d20c
@ -346,6 +346,19 @@ TestFuncResult test_str8_copy_str8_capped(void) {
|
||||
return wapp_tester_result(result);
|
||||
}
|
||||
|
||||
TestFuncResult test_str8_format(void) {
|
||||
bool result;
|
||||
|
||||
Str8 buf = wapp_str8_buf(128);
|
||||
Str8 expected = wapp_str8_lit("My name is Abdelrahman and I am 35 years old");
|
||||
|
||||
wapp_str8_format(&buf, "My name is %s and I am %u years old", "Abdelrahman", 35);
|
||||
|
||||
result = wapp_str8_equal(&buf, &expected);
|
||||
|
||||
return wapp_tester_result(result);
|
||||
}
|
||||
|
||||
TestFuncResult test_str8_find(void) {
|
||||
bool result;
|
||||
Str8RO s = wapp_str8_lit("Do as I say, not as I do");
|
||||
|
@ -23,6 +23,7 @@ TestFuncResult test_str8_slice(void);
|
||||
TestFuncResult test_str8_concat_capped(void);
|
||||
TestFuncResult test_str8_copy_cstr_capped(void);
|
||||
TestFuncResult test_str8_copy_str8_capped(void);
|
||||
TestFuncResult test_str8_format(void);
|
||||
TestFuncResult test_str8_find(void);
|
||||
TestFuncResult test_str8_rfind(void);
|
||||
TestFuncResult test_str8_split(void);
|
||||
|
@ -29,6 +29,7 @@ int main(void) {
|
||||
test_str8_concat_capped,
|
||||
test_str8_copy_cstr_capped,
|
||||
test_str8_copy_str8_capped,
|
||||
test_str8_format,
|
||||
test_str8_find,
|
||||
test_str8_rfind,
|
||||
test_str8_split,
|
||||
|
Loading…
Reference in New Issue
Block a user