Next: testing output, Previous: testing running, Up: testing [Contents][Index]
Compare the two parameters and return true if they are equal; return false otherwise. In the latter case print a message showing the expected value and the wrong one. Must be used as last command in a function, so that its return value is equal to that of the function.
Example:
function my-func () { echo $(($1 + $2)) } function mytest-1.1 () { dotest-result 5 `my-func 2 3` } dotest mytest-
another example:
function my-func () { echo $(($1 + $2)) } function mytest-1.1 () { dotest-result 5 `my-func 2 3` && \ dotest-result 5 `my-func 1 4` && \ dotest-result 5 `my-func 3 2` && \ } dotest mytest-
Next: testing output, Previous: testing running, Up: testing [Contents][Index]