test: move all module tests to the test/ directory
This commit is contained in:
28
test/core/ropes.c
Normal file
28
test/core/ropes.c
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <blue/core/rope.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
b_rope a = B_ROPE_CHAR('a');
|
||||
b_rope b = B_ROPE_CSTR_STATIC("Hello, world!");
|
||||
b_rope c = B_ROPE_INT(-4096);
|
||||
b_rope d = B_ROPE_UINT(4096);
|
||||
|
||||
b_rope str;
|
||||
|
||||
const b_rope *ropes[] = {
|
||||
&a,
|
||||
&b,
|
||||
&c,
|
||||
&d,
|
||||
};
|
||||
|
||||
b_rope_join(&str, ropes, sizeof ropes / sizeof ropes[0]);
|
||||
|
||||
char cstr[1024];
|
||||
b_rope_to_cstr(&str, cstr, sizeof cstr);
|
||||
b_rope_destroy(&str);
|
||||
|
||||
printf("%s\n", cstr);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user