Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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