No codegen doubly-linked list (#8)

Reviewed-on: #8
Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com>
Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit was merged in pull request #8.
This commit is contained in:
2025-12-17 03:53:13 +00:00
committed by Abdelrahman Said
parent 4b95a681d4
commit 4ea30f0762
43 changed files with 551 additions and 8249 deletions

View File

@@ -5,9 +5,9 @@
#include <string.h>
TestFuncResult test_commander_cmd_success(void) {
Str8List cmd = {0};
wapp_str8_list_push_back(&cmd, &wapp_str8_node_from_cstr("echo"));
wapp_str8_list_push_back(&cmd, &wapp_str8_node_from_cstr("hello world"));
Str8List cmd = wapp_dbl_list(Str8, Str8List);
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("hello world"));
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, &cmd);
b8 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
@@ -17,8 +17,8 @@ TestFuncResult test_commander_cmd_success(void) {
}
TestFuncResult test_commander_cmd_failure(void) {
Str8List cmd = {0};
wapp_str8_list_push_back(&cmd, &wapp_str8_node_from_cstr("grep"));
Str8List cmd = wapp_dbl_list(Str8, Str8List);
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("grep"));
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, NULL, &cmd);
b8 failed = result.exited && result.exit_code != EXIT_SUCCESS &&
@@ -33,9 +33,9 @@ TestFuncResult test_commander_cmd_out_buf_success(void) {
char msg[] = "hello world";
wapp_str8_copy_cstr_capped(&expected, msg);
Str8List cmd = {0};
wapp_str8_list_push_back(&cmd, &wapp_str8_node_from_cstr("echo"));
wapp_str8_list_push_back(&cmd, &wapp_str8_node_from_cstr(msg));
Str8List cmd = wapp_dbl_list(Str8, Str8List);
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr(msg));
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
b8 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
@@ -50,9 +50,9 @@ TestFuncResult test_commander_cmd_out_buf_failure(void) {
char msg[] = "hello world";
wapp_str8_copy_cstr_capped(&expected, msg);
Str8List cmd = {0};
wapp_str8_list_push_back(&cmd, &wapp_str8_node_from_cstr("echo"));
wapp_str8_list_push_back(&cmd, &wapp_str8_node_from_cstr(msg));
Str8List cmd = wapp_dbl_list(Str8, Str8List);
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr("echo"));
wapp_dbl_list_push_back(Str8, &cmd, &wapp_str8_node_from_cstr(msg));
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
b8 failed = !result.exited && result.exit_code != EXIT_SUCCESS &&

View File

@@ -5,11 +5,11 @@
#include <string.h>
TestFuncResult test_commander_cmd_success(void) {
Str8List cmd = {};
Str8List cmd = wapp_dbl_list(Str8, Str8List);
Str8Node echo = wapp_str8_node_from_cstr("echo");
Str8Node msg = wapp_str8_node_from_cstr("hello world");
wapp_str8_list_push_back(&cmd, &echo);
wapp_str8_list_push_back(&cmd, &msg);
wapp_dbl_list_push_back(Str8, &cmd, &echo);
wapp_dbl_list_push_back(Str8, &cmd, &msg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, nullptr, &cmd);
b8 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
@@ -19,9 +19,9 @@ TestFuncResult test_commander_cmd_success(void) {
}
TestFuncResult test_commander_cmd_failure(void) {
Str8List cmd = {};
Str8List cmd = wapp_dbl_list(Str8, Str8List);
Str8Node grep = wapp_str8_node_from_cstr("grep");
wapp_str8_list_push_back(&cmd, &grep);
wapp_dbl_list_push_back(Str8, &cmd, &grep);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_DISCARD, nullptr, &cmd);
b8 failed = result.exited && result.exit_code != EXIT_SUCCESS &&
@@ -36,11 +36,11 @@ TestFuncResult test_commander_cmd_out_buf_success(void) {
char msg[] = "hello world";
wapp_str8_copy_cstr_capped(&expected, msg);
Str8List cmd = {};
Str8List cmd = wapp_dbl_list(Str8, Str8List);
Str8Node echo = wapp_str8_node_from_cstr("echo");
Str8Node arg = wapp_str8_node_from_cstr(msg);
wapp_str8_list_push_back(&cmd, &echo);
wapp_str8_list_push_back(&cmd, &arg);
wapp_dbl_list_push_back(Str8, &cmd, &echo);
wapp_dbl_list_push_back(Str8, &cmd, &arg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
b8 succeeded = result.exited && result.exit_code == EXIT_SUCCESS &&
@@ -55,11 +55,11 @@ TestFuncResult test_commander_cmd_out_buf_failure(void) {
char msg[] = "hello world";
wapp_str8_copy_cstr_capped(&expected, msg);
Str8List cmd = {};
Str8List cmd = wapp_dbl_list(Str8, Str8List);
Str8Node echo = wapp_str8_node_from_cstr("echo");
Str8Node arg = wapp_str8_node_from_cstr(msg);
wapp_str8_list_push_back(&cmd, &echo);
wapp_str8_list_push_back(&cmd, &arg);
wapp_dbl_list_push_back(Str8, &cmd, &echo);
wapp_dbl_list_push_back(Str8, &cmd, &arg);
CMDResult result = wapp_shell_commander_execute(SHELL_OUTPUT_CAPTURE, &buf, &cmd);
b8 failed = !result.exited && result.exit_code != EXIT_SUCCESS &&