diff options
| author | Paul Buetow <paul@buetow.org> | 2021-05-11 19:53:02 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-05-11 19:53:02 +0100 |
| commit | e19b4a4b4287c10592ac59a09f1ec29293d29c08 (patch) | |
| tree | 7819b6bf43fa3fba35427f85263b14582d4070d3 /lib/assert.source.sh | |
| parent | 6d77b5a1540cef0b76246efca262f3392e448e6e (diff) | |
refactor
Diffstat (limited to 'lib/assert.source.sh')
| -rw-r--r-- | lib/assert.source.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/assert.source.sh b/lib/assert.source.sh new file mode 100644 index 00000000..3367809d --- /dev/null +++ b/lib/assert.source.sh @@ -0,0 +1,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" +} |
