Update dbl list C tests

This commit is contained in:
2025-12-17 02:52:29 +00:00
parent 80308172ec
commit e90901406e
4 changed files with 135 additions and 135 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 &&