mirror of
https://github.com/tailix/libkernaux.git
synced 2025-04-07 17:32:45 -04:00
Main: improve test generator for cmdline
This commit is contained in:
parent
61a4247627
commit
ea8ef8fc95
1 changed files with 7 additions and 7 deletions
|
@ -28,15 +28,11 @@ int main()
|
|||
{
|
||||
{% for case in cases %}
|
||||
{
|
||||
{% if not case.error %}
|
||||
const char *const expected_argv[{{ escape_int(len(case.result) or 1) }}] = {
|
||||
{% if len(case.result) %}
|
||||
{% if not case.error and len(case.result) %}
|
||||
const char *const expected_argv[] = {
|
||||
{% for item in case.result %}
|
||||
{{ escape_str(item) }},
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
NULL,
|
||||
{% endif %}
|
||||
};
|
||||
{% endif %}
|
||||
|
||||
|
@ -48,7 +44,11 @@ int main()
|
|||
true,
|
||||
"",
|
||||
{{ escape_int(len(case.result)) }},
|
||||
expected_argv
|
||||
{% if len(case.result) %}
|
||||
expected_argv
|
||||
{% else %}
|
||||
NULL
|
||||
{% endif %}
|
||||
{% else %}
|
||||
false,
|
||||
{{ escape_str(case.error) }},
|
||||
|
|
Loading…
Add table
Reference in a new issue