Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
11
Task/Assertions/UNIX-Shell/assertions.sh
Normal file
11
Task/Assertions/UNIX-Shell/assertions.sh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
assert() {
|
||||
if test ! $1; then
|
||||
[[ $2 ]] && echo "$2" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
x=42
|
||||
assert "$x -eq 42" "that's not the answer"
|
||||
((x--))
|
||||
assert "$x -eq 42" "that's not the answer"
|
||||
echo "won't get here"
|
||||
Loading…
Add table
Add a link
Reference in a new issue