Add tests for Str8List utilities

This commit is contained in:
2025-02-15 20:29:50 +00:00
parent 68fe421ab0
commit d635e03cd8
5 changed files with 295 additions and 0 deletions

View File

@@ -201,6 +201,21 @@ TestFuncResult test_str8_set(void) {
return wapp_tester_result(result);
}
TestFuncResult test_str8_equal(void) {
bool result;
Str8RO s1 = wapp_str8_lit_ro("hello");
Str8RO s2 = wapp_str8_lit_ro("hell");
Str8RO s3 = wapp_str8_lit_ro("hello");
Str8RO s4 = wapp_str8_lit_ro("goodbye");
result = wapp_str8_equal(&s1, &s2) == false;
result = result && wapp_str8_equal(&s1, &s3) == true;
result = result && wapp_str8_equal(&s1, &s4) == false;
return wapp_tester_result(result);
}
TestFuncResult test_str8_substr(void) {
bool result;
Str8 s = wapp_str8_lit("Different strokes for different folks");