Add test for wapp_str8_format
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user