add all old corelib tests
This commit is contained in:
24
object-test/strings.c
Normal file
24
object-test/strings.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <blue/core/stringstream.h>
|
||||
#include <blue/object/string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
b_string *str = b_string_create_from_cstr("Hello, world!\n");
|
||||
b_string_insert_cstr(str, "WOW!", 4);
|
||||
|
||||
printf("%s\n", b_string_ptr(str));
|
||||
|
||||
b_string_release(str);
|
||||
|
||||
b_stringstream strv;
|
||||
b_stringstream_begin_dynamic(&strv);
|
||||
b_stringstream_add_many(&strv, "Hello", ", world", "!", NULL);
|
||||
char *s = b_stringstream_end(&strv);
|
||||
|
||||
printf("%s\n", s);
|
||||
free(s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user