test: move all module tests to the test/ directory
This commit is contained in:
26
test/ds/unicode-strings.c
Normal file
26
test/ds/unicode-strings.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <blue/core/stringstream.h>
|
||||
#include <blue/ds/string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("здравс\u26A0твуите\n");
|
||||
b_string *str = b_string_create_from_cstr("здравствуите");
|
||||
const char *s = b_string_ptr(str);
|
||||
printf("%s\n", s);
|
||||
printf("len: %zu\n", b_string_get_size(str, B_STRLEN_NORMAL));
|
||||
printf("codepoints: %zu\n", b_string_get_size(str, B_STRLEN_CODEPOINTS));
|
||||
|
||||
const char *delims[] = {"в"};
|
||||
size_t nr_delims = sizeof delims / sizeof delims[0];
|
||||
|
||||
b_iterator *it = b_string_tokenise(str, delims, nr_delims, 0);
|
||||
b_foreach(const char *, tok, it)
|
||||
{
|
||||
printf("%s\n", tok);
|
||||
}
|
||||
b_iterator_unref(it);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user