summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorGuido G√ľnther <agx@sigxcpu.org>2014-10-02 19:15:00 +0200
committerGuido G√ľnther <agx@sigxcpu.org>2014-10-08 10:29:58 +0200
commite6832e2a65dfe16223dc4f6480c55aaed954540a (patch)
tree2ee2fd6d94e0412739fd389d9991eee6789aa219 /README.markdown
parentc5cc97362a9f595fe80f65f13d176589ffd62f14 (diff)
Add validate_nonemptyhash and validate_nonemptyhash_msg for consistencyHEADmaster
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown35
1 files changed, 35 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 03a7284..9eb3fcd 100644
--- a/README.markdown
+++ b/README.markdown
@@ -86,3 +86,38 @@ The following values will fail, causing compilation to abort with the given msg:
validate_nonemptyarray_msg(true, 'Not a nonempty array')
validate_nonemptyarray_msg([], 'Not a nonempty array')
+
+validate_nonemptyhash
+---------------------
+Validate that all passed values are hash data structures. Abort catalog
+compilation if any value fails this check. Also abort if any of the hashes
+is empty.
+
+The following values will pass:
+
+ $my_hash = { 'one' => 'two' }
+ validate_nonemptyhash($my_array)
+
+The following values will fail, causing compilation to abort:
+
+ validate_nonemptyhash(true)
+ validate_nonemptyhash([])
+ validate_nonemptyhash('some_string')
+ $undefined = undef
+ validate_nonemptyhash($undefined)
+
+validate_nonemptyhash_msg
+-------------------------
+Validate that the passed value is an hash data structure. Abort catalog
+compilation if any value fails this check. Also abort if any of the hashs
+is empty. On failure it prints the message given as the second argument.
+
+The following values will pass:
+
+ $my_hash = { 'one', 'two' }
+ validate_nonemptyhash_msg($my_hash, 'foo')
+
+The following values will fail, causing compilation to abort with the given msg:
+
+ validate_nonemptyhash_msg(true, 'Not a nonempty hash')
+ validate_nonemptyhash_msg([], 'Not a nonempty hash')