Add wapp_str8_from_bytes
This commit is contained in:
@@ -612,3 +612,17 @@ TestFuncResult test_str8_join(void) {
|
||||
|
||||
return wapp_tester_result(result);
|
||||
}
|
||||
|
||||
TestFuncResult test_str8_from_bytes(void) {
|
||||
bool result;
|
||||
|
||||
Str8 str = wapp_str8_buf(1024);
|
||||
Str8 expected = wapp_str8_lit_ro("WAPP");
|
||||
U8Array bytes = wapp_u8_array('W', 'A', 'P', 'P');
|
||||
wapp_str8_from_bytes(&str, &bytes);
|
||||
|
||||
result = str.size == bytes.count * bytes.item_size;
|
||||
result = result && wapp_str8_equal(&str, &expected);
|
||||
|
||||
return wapp_tester_result(result);
|
||||
}
|
||||
|
Reference in New Issue
Block a user