diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-23 12:23:04 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-23 12:23:04 (EDT) |
commit | 572ecb49ee367e0bbe237431f190127b408db723 (patch) | |
tree | f17234b39931ac827415a6654315d48cb02a3e54 /tests/aux | |
parent | 2fd577fdf7293c0d9ecc506bdcb027fba238c024 (diff) |
tests/aux/common.sh: Add is()
Copied from opkbuild.
Diffstat (limited to 'tests/aux')
-rw-r--r-- | tests/aux/common.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/aux/common.sh b/tests/aux/common.sh index 27db133..3082ab0 100644 --- a/tests/aux/common.sh +++ b/tests/aux/common.sh @@ -1,6 +1,6 @@ # Common testsuite functions # -# Copyright (C) 2019 Patrick McDermott +# Copyright (C) 2018, 2019 Patrick McDermott # # This file is part of the ProteanOS Development Kit. # @@ -21,6 +21,23 @@ LF=' ' +is() +{ + local description="${1}" + local got="${2}" + local expected="${3}" + shift 3 + + if [ "x${got}" = "x${expected}" ]; then + ok_ -- "${description}" + else + not_ok_ -- "${description}" + diag_ " Failed test '${description}'" + diag_ " got: '${got}'" + diag_ " expected: '${expected}'" + fi +} + # is_diff() is based on cmd_is() from opkbuild 4.0.2, with test results passed # by argument and context added to the diagnostic output. is_diff() |