bash-fun/test/try_test.sh
2018-03-10 22:07:30 +01:00

9 lines
No EOL
254 B
Bash
Executable file

#! /bin/bash
testTry() {
assertEquals 1 "$(echo 'expr 2 / 2' | try lambda _ . 'ret 0')"
assertEquals 0 "$(echo 'expr 2 / 0' | try lambda _ . 'ret 0')"
assertEquals 2 "$(echo 'expr 2 / 0' | try lambda status . 'ret $status')"
}
. ./shunit2-init.sh