meta: rename to fx
This commit is contained in:
@@ -1,42 +1,42 @@
|
||||
#include <CuTest.h>
|
||||
#include <blue/ds/string.h>
|
||||
#include <fx/ds/string.h>
|
||||
|
||||
static void test_string_create(CuTest *tc)
|
||||
{
|
||||
b_string *str = b_string_create();
|
||||
fx_string *str = fx_string_create();
|
||||
|
||||
CuAssertPtrNotNull(tc, str);
|
||||
CuAssertIntEquals(tc, 0, b_string_get_size(str, B_STRLEN_NORMAL));
|
||||
CuAssertStrEquals(tc, "", b_string_ptr(str));
|
||||
CuAssertIntEquals(tc, 0, fx_string_get_size(str, FX_STRLEN_NORMAL));
|
||||
CuAssertStrEquals(tc, "", fx_string_ptr(str));
|
||||
|
||||
b_string_unref(str);
|
||||
fx_string_unref(str);
|
||||
|
||||
str = b_string_create_from_c('A', 8);
|
||||
str = fx_string_create_from_c('A', 8);
|
||||
|
||||
CuAssertPtrNotNull(tc, str);
|
||||
CuAssertIntEquals(tc, 8, b_string_get_size(str, B_STRLEN_NORMAL));
|
||||
CuAssertStrEquals(tc, "AAAAAAAA", b_string_ptr(str));
|
||||
CuAssertIntEquals(tc, 8, fx_string_get_size(str, FX_STRLEN_NORMAL));
|
||||
CuAssertStrEquals(tc, "AAAAAAAA", fx_string_ptr(str));
|
||||
|
||||
b_string_unref(str);
|
||||
fx_string_unref(str);
|
||||
|
||||
str = b_string_create_from_cstr("Hello, world!");
|
||||
str = fx_string_create_from_cstr("Hello, world!");
|
||||
|
||||
CuAssertPtrNotNull(tc, str);
|
||||
CuAssertIntEquals(tc, 13, b_string_get_size(str, B_STRLEN_NORMAL));
|
||||
CuAssertStrEquals(tc, "Hello, world!", b_string_ptr(str));
|
||||
CuAssertIntEquals(tc, 13, fx_string_get_size(str, FX_STRLEN_NORMAL));
|
||||
CuAssertStrEquals(tc, "Hello, world!", fx_string_ptr(str));
|
||||
|
||||
b_string_unref(str);
|
||||
fx_string_unref(str);
|
||||
}
|
||||
|
||||
static void test_string_length(CuTest *tc)
|
||||
{
|
||||
const char *cstr = "Hello, \033[91;1mworld!";
|
||||
b_string *s = b_string_create_from_cstr(cstr);
|
||||
fx_string *s = fx_string_create_from_cstr(cstr);
|
||||
|
||||
CuAssertIntEquals(tc, 13, b_string_get_size(s, B_STRLEN_IGNORE_ESC));
|
||||
CuAssertIntEquals(tc, 20, b_string_get_size(s, B_STRLEN_NORMAL));
|
||||
CuAssertIntEquals(tc, 13, fx_string_get_size(s, FX_STRLEN_IGNORE_ESC));
|
||||
CuAssertIntEquals(tc, 20, fx_string_get_size(s, FX_STRLEN_NORMAL));
|
||||
|
||||
b_string_unref(s);
|
||||
fx_string_unref(s);
|
||||
}
|
||||
|
||||
CuSuite *get_all_tests(void)
|
||||
|
||||
Reference in New Issue
Block a user