Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 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