Added docblocks for remaining core expectations

env
Mike Gerwitz 2014-05-13 20:31:56 -04:00
parent d7c97bb614
commit eb188fe477
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 15 additions and 0 deletions

View File

@ -64,10 +64,21 @@ __chk-nshift()
_expect--be() { _proxy-to "$@"; }
##
# Basic success and failure (zero or non-zero exit code)
_expect--succeed() { test "$1" -eq 0; }
_expect--fail() { test "$1" -ne 0; }
##
# Expect that the given string is output on stdout or stderr
#
# Defaults to asserting against stdout; behavior may be overridden with the
# `on stderr' clause. Specifying `on stdout' may be used for clarity, but is
# redundant.
#
# This expectation assumes a trailing newline by default; this behavior can
# be suppressed with the `without newline' clause.
_expect--output()
{
local -ri nshift="$2"
@ -99,6 +110,7 @@ _expect--output()
aok "${PIPESTATUS[@]}"
}
# parses output remainder clause according to the aforementioned rules
__expect--output-clause()
{
[ $# -gt 0 ] || return 0
@ -123,6 +135,9 @@ __expect--output-clause()
}
##
# Expects that stdout matches the provided extended regular expression (as
# in regex(3))
_expect--match()
{
shift "$2"