Thanks for the quick reply.
Here's a better patch.

Bernhard Voelker wrote, On 04/02/2013 04:03 AM:

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

Done. Also added IN_PIPE .

> Close square brackets, and move blank character to after the comma:

Done.

> 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.

I do not fully understand those uses, so I can't really explain them.
When are these useful?

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

I've added "IN" and "IN_PIPE".
"EXIT" was already mentioned.
"AUX" - I do not know what it does...

-gordon



>From 309fd6398558b6e85ae2b2fa1cee6b5e2f492dde Mon Sep 17 00:00:00 2001
From: Assaf Gordon <[email protected]>
Date: Mon, 1 Apr 2013 17:44:27 -0400
Subject: [PATCH] tests: document more test keys in unit test module

* tests/Coreutils.pm: document IN/IN_PIPE/CMP/PRE/POST keys.
---
 tests/Coreutils.pm |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm
index 71b1516..661fce4 100644
--- a/tests/Coreutils.pm
+++ b/tests/Coreutils.pm
@@ -54,8 +54,12 @@ 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, IN_PIPE, OUT, ERR, AUX, CMP,
+#                                         EXIT, PRE, POST
 # - the value must be a file spec
+# {IN  => 'data'}    Create file containing 'data'. The filename will be
+#                    appended as the last parameter on the command-line.
+# {IN_PIPE => 'data'} Send 'data' as input from stdin.
 # {OUT => 'data'}    put data in a temp file and compare it to stdout from cmd
 # {OUT => {'filename'=>undef}} compare contents of existing filename to
 #           stdout from cmd
@@ -82,6 +86,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'.
+# {PRE => sub{}}   Execute sub() before running the test.
+# {POST => sub{}}  Execute sub() after running the test.
+#   If the PRE/POST sub calls "die", the test will be marked as failed.
 #
 # There may be many input file specs.  File names from the input specs
 # are concatenated in order on the command line.
-- 
1.7.7.4

Reply via email to