Start str8 renaming
This commit is contained in:
+26
-26
@@ -9,23 +9,23 @@
|
||||
WpTestFuncResult test_cpath_join_path(void) {
|
||||
b8 result;
|
||||
|
||||
Str8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
Str8 out = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
Str8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
WpStr8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
WpStr8 out = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
WpStr8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
|
||||
wapp_str8_format(&expected, "%chome%cabdelrahman%cDocuments", WAPP_PATH_SEP, WAPP_PATH_SEP, WAPP_PATH_SEP);
|
||||
wapp_str8_format(&tmp, "%c", WAPP_PATH_SEP);
|
||||
|
||||
Str8List parts = wapp_dbl_list(Str8);
|
||||
wapp_dbl_list_push_back(Str8, &parts, &tmp);
|
||||
wapp_dbl_list_push_back(Str8, &parts, &wapp_str8_lit("home"));
|
||||
wapp_dbl_list_push_back(Str8, &parts, &wapp_str8_lit("abdelrahman"));
|
||||
wapp_dbl_list_push_back(Str8, &parts, &wapp_str8_lit("Documents"));
|
||||
WpStr8List parts = wapp_dbl_list(WpStr8);
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &tmp);
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &wapp_str8_lit("home"));
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &wapp_str8_lit("abdelrahman"));
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &wapp_str8_lit("Documents"));
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_dbl_list_pop_front(Str8, &parts);
|
||||
wapp_dbl_list_pop_front(WpStr8, &parts);
|
||||
|
||||
wapp_str8_format(&expected, "home%cabdelrahman%cDocuments", WAPP_PATH_SEP, WAPP_PATH_SEP);
|
||||
|
||||
@@ -33,8 +33,8 @@ WpTestFuncResult test_cpath_join_path(void) {
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_str8_concat_capped(&tmp, &wapp_str8_lit_ro("home"));
|
||||
wapp_dbl_list_pop_front(Str8, &parts);
|
||||
wapp_dbl_list_push_front(Str8, &parts, &tmp);
|
||||
wapp_dbl_list_pop_front(WpStr8, &parts);
|
||||
wapp_dbl_list_push_front(WpStr8, &parts, &tmp);
|
||||
|
||||
wapp_str8_format(&expected, "%chome%cabdelrahman%cDocuments", WAPP_PATH_SEP, WAPP_PATH_SEP, WAPP_PATH_SEP);
|
||||
|
||||
@@ -42,35 +42,35 @@ WpTestFuncResult test_cpath_join_path(void) {
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_str8_format(&tmp, "home%c", WAPP_PATH_SEP);
|
||||
wapp_dbl_list_pop_front(Str8, &parts);
|
||||
wapp_dbl_list_push_front(Str8, &parts, &wapp_str8_lit("home"));
|
||||
wapp_dbl_list_pop_front(WpStr8, &parts);
|
||||
wapp_dbl_list_push_front(WpStr8, &parts, &wapp_str8_lit("home"));
|
||||
|
||||
wapp_str8_format(&expected, "home%cabdelrahman%cDocuments", WAPP_PATH_SEP, WAPP_PATH_SEP);
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_dbl_list_empty(Str8, &parts);
|
||||
wapp_dbl_list_empty(WpStr8, &parts);
|
||||
|
||||
wapp_str8_format(&tmp, "%chome", WAPP_PATH_SEP);
|
||||
wapp_dbl_list_push_back(Str8, &parts, &tmp);
|
||||
wapp_dbl_list_push_back(Str8, &parts, &wapp_str8_lit(""));
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &tmp);
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &wapp_str8_lit(""));
|
||||
|
||||
wapp_str8_format(&expected, "%chome", WAPP_PATH_SEP);
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_dbl_list_pop_front(Str8, &parts);
|
||||
wapp_dbl_list_push_back(Str8, &parts, &wapp_str8_lit(""));
|
||||
wapp_dbl_list_pop_front(WpStr8, &parts);
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &wapp_str8_lit(""));
|
||||
|
||||
wapp_str8_format(&expected, "%s", "");
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_dbl_list_pop_back(Str8, &parts);
|
||||
wapp_dbl_list_push_back(Str8, &parts, &wapp_str8_lit("home"));
|
||||
wapp_dbl_list_pop_back(WpStr8, &parts);
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &wapp_str8_lit("home"));
|
||||
|
||||
wapp_str8_copy_cstr_capped(&expected, "home");
|
||||
|
||||
@@ -87,10 +87,10 @@ WpTestFuncResult test_cpath_dirname(void) {
|
||||
}
|
||||
|
||||
b8 result;
|
||||
Str8 *output = NULL;
|
||||
WpStr8 *output = NULL;
|
||||
|
||||
Str8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
Str8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
WpStr8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
WpStr8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
|
||||
// CASE 1
|
||||
wapp_str8_format(&tmp, "%c", WAPP_PATH_SEP);
|
||||
@@ -135,10 +135,10 @@ WpTestFuncResult test_cpath_dirup(void) {
|
||||
}
|
||||
|
||||
b8 result;
|
||||
Str8 *output = NULL;
|
||||
WpStr8 *output = NULL;
|
||||
|
||||
Str8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
Str8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
WpStr8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
WpStr8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
|
||||
// CASE 1
|
||||
wapp_str8_format(&tmp, "%c", WAPP_PATH_SEP);
|
||||
|
||||
+35
-35
@@ -9,41 +9,41 @@
|
||||
WpTestFuncResult test_cpath_join_path(void) {
|
||||
b8 result;
|
||||
|
||||
Str8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
Str8 out = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
Str8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
WpStr8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
WpStr8 out = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
WpStr8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
|
||||
wapp_str8_format(&expected, "%chome%cabdelrahman%cDocuments", WAPP_PATH_SEP, WAPP_PATH_SEP, WAPP_PATH_SEP);
|
||||
wapp_str8_format(&tmp, "%c", WAPP_PATH_SEP);
|
||||
|
||||
Str8List parts = wapp_dbl_list(Str8);
|
||||
WpStr8List parts = wapp_dbl_list(WpStr8);
|
||||
|
||||
wapp_dbl_list_push_back(Str8, &parts, &tmp);
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &tmp);
|
||||
|
||||
Str8 home = wapp_str8_lit("home");
|
||||
wapp_dbl_list_push_back(Str8, &parts, &home);
|
||||
WpStr8 home = wapp_str8_lit("home");
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &home);
|
||||
|
||||
Str8 user = wapp_str8_lit("abdelrahman");
|
||||
wapp_dbl_list_push_back(Str8, &parts, &user);
|
||||
WpStr8 user = wapp_str8_lit("abdelrahman");
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &user);
|
||||
|
||||
Str8 docs = wapp_str8_lit("Documents");
|
||||
wapp_dbl_list_push_back(Str8, &parts, &docs);
|
||||
WpStr8 docs = wapp_str8_lit("Documents");
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &docs);
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_dbl_list_pop_front(Str8, &parts);
|
||||
wapp_dbl_list_pop_front(WpStr8, &parts);
|
||||
|
||||
wapp_str8_format(&expected, "home%cabdelrahman%cDocuments", WAPP_PATH_SEP, WAPP_PATH_SEP);
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
Str8RO str = wapp_str8_lit_ro("home");
|
||||
WpStr8RO str = wapp_str8_lit_ro("home");
|
||||
wapp_str8_concat_capped(&tmp, &str);
|
||||
wapp_dbl_list_pop_front(Str8, &parts);
|
||||
wapp_dbl_list_pop_front(WpStr8, &parts);
|
||||
|
||||
wapp_dbl_list_push_front(Str8, &parts, &tmp);
|
||||
wapp_dbl_list_push_front(WpStr8, &parts, &tmp);
|
||||
|
||||
wapp_str8_format(&expected, "%chome%cabdelrahman%cDocuments", WAPP_PATH_SEP, WAPP_PATH_SEP, WAPP_PATH_SEP);
|
||||
|
||||
@@ -51,44 +51,44 @@ WpTestFuncResult test_cpath_join_path(void) {
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_str8_format(&tmp, "home%c", WAPP_PATH_SEP);
|
||||
wapp_dbl_list_pop_front(Str8, &parts);
|
||||
wapp_dbl_list_pop_front(WpStr8, &parts);
|
||||
|
||||
Str8 home_2 = wapp_str8_lit("home");
|
||||
wapp_dbl_list_push_front(Str8, &parts, &home_2);
|
||||
WpStr8 home_2 = wapp_str8_lit("home");
|
||||
wapp_dbl_list_push_front(WpStr8, &parts, &home_2);
|
||||
|
||||
wapp_str8_format(&expected, "home%cabdelrahman%cDocuments", WAPP_PATH_SEP, WAPP_PATH_SEP);
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_dbl_list_empty(Str8, &parts);
|
||||
wapp_dbl_list_empty(WpStr8, &parts);
|
||||
|
||||
wapp_str8_format(&tmp, "%chome", WAPP_PATH_SEP);
|
||||
|
||||
wapp_dbl_list_push_back(Str8, &parts, &tmp);
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &tmp);
|
||||
|
||||
Str8 empty = wapp_str8_lit("");
|
||||
wapp_dbl_list_push_back(Str8, &parts, &empty);
|
||||
WpStr8 empty = wapp_str8_lit("");
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &empty);
|
||||
|
||||
wapp_str8_format(&expected, "%chome", WAPP_PATH_SEP);
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_dbl_list_pop_front(Str8, &parts);
|
||||
wapp_dbl_list_pop_front(WpStr8, &parts);
|
||||
|
||||
Str8 empty_2 = wapp_str8_lit("");
|
||||
wapp_dbl_list_push_back(Str8, &parts, &empty_2);
|
||||
WpStr8 empty_2 = wapp_str8_lit("");
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &empty_2);
|
||||
|
||||
wapp_str8_format(&expected, "%s", "");
|
||||
|
||||
wapp_cpath_join_path(&out, &parts);
|
||||
result = result && wapp_str8_equal(&out, &expected);
|
||||
|
||||
wapp_dbl_list_pop_back(Str8, &parts);
|
||||
wapp_dbl_list_pop_back(WpStr8, &parts);
|
||||
|
||||
Str8 home_3 = wapp_str8_lit("home");
|
||||
wapp_dbl_list_push_back(Str8, &parts, &home_3);
|
||||
WpStr8 home_3 = wapp_str8_lit("home");
|
||||
wapp_dbl_list_push_back(WpStr8, &parts, &home_3);
|
||||
|
||||
wapp_str8_copy_cstr_capped(&expected, "home");
|
||||
|
||||
@@ -105,10 +105,10 @@ WpTestFuncResult test_cpath_dirname(void) {
|
||||
}
|
||||
|
||||
b8 result;
|
||||
Str8 *output = nullptr;
|
||||
WpStr8 *output = nullptr;
|
||||
|
||||
Str8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
Str8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
WpStr8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
WpStr8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
|
||||
// CASE 1
|
||||
wapp_str8_format(&tmp, "%c", WAPP_PATH_SEP);
|
||||
@@ -120,7 +120,7 @@ WpTestFuncResult test_cpath_dirname(void) {
|
||||
// CASE 2
|
||||
wapp_str8_format(&expected, "%s", ".");
|
||||
|
||||
Str8 path = wapp_str8_lit("home");
|
||||
WpStr8 path = wapp_str8_lit("home");
|
||||
output = wapp_cpath_dirname(&arena, &path);
|
||||
result = result && output != nullptr && wapp_str8_equal(output, &expected);
|
||||
|
||||
@@ -155,10 +155,10 @@ WpTestFuncResult test_cpath_dirup(void) {
|
||||
}
|
||||
|
||||
b8 result;
|
||||
Str8 *output = nullptr;
|
||||
WpStr8 *output = nullptr;
|
||||
|
||||
Str8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
Str8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
WpStr8 expected = wapp_str8_buf(MAIN_BUF_SIZE);
|
||||
WpStr8 tmp = wapp_str8_buf(TMP_BUF_SIZE);
|
||||
|
||||
// CASE 1
|
||||
wapp_str8_format(&tmp, "%c", WAPP_PATH_SEP);
|
||||
|
||||
Reference in New Issue
Block a user