meta: re-organise tests
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include <fx/core/stringstream.h>
|
||||
#include <fx/ds/string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("здравс\u26A0твуите\n");
|
||||
fx_string *str = fx_string_create_from_cstr("здравствуите");
|
||||
const char *s = fx_string_get_cstr(str);
|
||||
printf("%s\n", s);
|
||||
printf("len: %zu\n", fx_string_get_size(str, FX_STRLEN_NORMAL));
|
||||
printf("codepoints: %zu\n", fx_string_get_size(str, FX_STRLEN_CODEPOINTS));
|
||||
|
||||
const char *delims[] = {"в"};
|
||||
size_t nr_delims = sizeof delims / sizeof delims[0];
|
||||
|
||||
fx_iterator *it = fx_string_tokenise(str, delims, nr_delims, 0);
|
||||
fx_foreach(const char *, tok, it)
|
||||
{
|
||||
printf("%s\n", tok);
|
||||
}
|
||||
fx_iterator_unref(it);
|
||||
fx_string_unref(str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user