Skip to content

Commit

Permalink
test_proc_args: Print arguments separated with newlines.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1920853 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ivan Zhakov committed Sep 23, 2024
1 parent d8c5b53 commit 27b0370
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 1 addition & 2 deletions test/echoargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ int main(int argc, const char * const *argv, const char* const* env)
apr_file_open_stdout(&file, pool);
for (i = 1; i < argc; i++)
{
if (i > 1) apr_file_puts(",", file);
apr_file_puts(argv[i], file);
apr_file_printf(file, "%d: [%s]\n", i, argv[i]);
}

apr_terminate();
Expand Down
18 changes: 10 additions & 8 deletions test/testproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,16 @@ static void test_proc_args(abts_case* tc, void* data)
actual = apr_pstrcat(p, actual, buf, NULL);
}

expected = "1" ","
"" ","
"\"te st" ","
" a\\b" ","
" a\\\\b" ","
" \\" ","
"new\nline" ","
" \\\\";
expected =
"1: [1]" "\n"
"2: []" "\n"
"3: [\"te st]" "\n"
"4: [ a\\b]" "\n"
"5: [ a\\\\b]" "\n"
"6: [ \\]" "\n"
"7: [new\nline]" "\n"
"8: [ \\\\]" "\n";

ABTS_STR_EQUAL(tc, expected, actual);
}

Expand Down

0 comments on commit 27b0370

Please sign in to comment.