summaryrefslogtreecommitdiff
path: root/modules/assert.source.sh
blob: 3367809dd67b46ba41c8827ab29d158d88517e03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
assert::equals () {
    local -r result="$1"; shift
    local -r expected="$1"; shift

    if [ "$result" != "$expected" ]; then
        cat <<ERROR
Expected
    '$expected'
But got
    '$result'
ERROR
        exit 2
    fi

    echo "Assert OK: $expected"
}