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);
|
||||
|
||||
Reference in New Issue
Block a user