coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests: document CMP/PRE/POST in unit test module


From: Bernhard Voelker
Subject: Re: [PATCH] tests: document CMP/PRE/POST in unit test module
Date: Tue, 2 Apr 2013 10:03:17 +0200 (CEST)

> On April 1, 2013 at 11:47 PM Assaf Gordon <address@hidden> wrote:
> Attached is a small patch to document CMP/PRE/POST in "tests/Coreutils.pm".
> No code changes.

Thanks for working on that.
Here are a few nits:

> diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm
> index 71b1516..fd4408a 100644
> --- a/tests/Coreutils.pm
> +++ b/tests/Coreutils.pm
> @@ -54,7 +54,7 @@ defined $ENV{DJDIR}
>  # I/O spec: a hash ref with the following properties
>  # ================
>  # - one key/value pair
> -# - the key must be one of these strings: IN, OUT, ERR, AUX, CMP, EXIT
> +# - the key must be one of these strings: IN, OUT, ERR, AUX, CMP, EXIT,
> PRE,POST
>  # - the value must be a file spec
>  # {OUT => 'data'}    put data in a temp file and compare it to stdout from
> cmd
>  # {OUT => {'filename'=>undef}} compare contents of existing filename to

s/PRE,POST/PRE, POST
due to the line length it may be worth adding a line break.

> @@ -82,6 +82,12 @@ defined $ENV{DJDIR}
>  # {ENV_DEL => 'VAR'}
>  #   Remove VAR from the environment just before running the corresponding
>  #   command, and restore any value just afterwards.
> +# {CMP => [ 'data',{'filename'=>undef}}    Compare the content of 'filename'
> +#   to 'data' (a string scalar). The program under test is expected to create
> +#   file 'filename'.

Close square brackets, and move blank character to after the comma:
-+# {CMP => [ 'data',{'filename'=>undef}}    Compare the content of 'filename'
++# {CMP => ['data', {'filename'=>undef}]    Compare the content of 'filename'

2 notes:
* According to the code, instead of a plain string, 'data' can also be a HASH.
* If the file name is '@AUX@', then it is replaced.

Furthermore, IN, AUX, and EXIT also do not seem to be documented yet.
Do you like to document these, too?

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]