From 99961c4561f478523048ed69b37b37c432c42b8a Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Thu, 13 Jan 2011 17:41:08 -0700 Subject: kill run_handler, inject_handler_args, strfree and sync_stdout --- tests/test-command.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) (limited to 'tests') diff --git a/tests/test-command.c b/tests/test-command.c index 20c6aa0..d07bf79 100644 --- a/tests/test-command.c +++ b/tests/test-command.c @@ -263,11 +263,12 @@ test_toggle_status (void) { void test_sync_sh (void) { - parse_cmd_line("sync_sh 'echo Test echo.'", NULL); - g_assert_cmpstr("Test echo.\n", ==, uzbl.comm.sync_stdout); + GString *result = g_string_new(""); + + parse_cmd_line("sync_sh 'echo Test echo.'", result); + g_assert_cmpstr("Test echo.\n", ==, result->str); - /* clean up after ourselves */ - uzbl.comm.sync_stdout = strfree(uzbl.comm.sync_stdout); + g_string_free(result, TRUE); } void @@ -296,29 +297,6 @@ test_last_result (void) { g_string_free(result, TRUE); } -void -test_run_handler_arg_order (void) { - run_handler("sync_spawn echo uvw xyz", "abc def"); - - assert(uzbl.comm.sync_stdout); - - /* the rest of the result should be the arguments passed to run_handler. */ - /* the arguments in the second argument to run_handler should be placed before any - * included in the first argument to run handler. */ - g_assert_cmpstr("abc def uvw xyz\n", ==, uzbl.comm.sync_stdout); -} - -void -test_run_handler_expand (void) { - uzbl.net.useragent = "Test uzbl uzr agent"; - run_handler("sync_spawn echo @useragent", "result:"); - - assert(uzbl.comm.sync_stdout); - - /* the user-specified arguments to the handler should have been expanded */ - g_assert_cmpstr("result: Test uzbl uzr agent\n", ==, uzbl.comm.sync_stdout); -} - int main (int argc, char *argv[]) { /* set up tests */ @@ -337,11 +315,6 @@ main (int argc, char *argv[]) { g_test_add_func("/test-command/last-result", test_last_result); - /* the following aren't really "command" tests, but they're not worth - * splitting into a separate file yet */ - g_test_add_func("/test-command/run_handler/arg-order", test_run_handler_arg_order); - g_test_add_func("/test-command/run_handler/expand", test_run_handler_expand); - /* set up uzbl */ initialize(argc, argv); -- cgit v1.2.3