-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restyle release: added ability to do dry runs of releases (#1102)
* Restyled by shfmt * Restyled by whitespace --------- Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
1 parent
2aa8ce0
commit d23d9f3
Showing
2 changed files
with
28 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
assert() { | ||
local actual | ||
actual="$(bash -c "$1")" | ||
if [[ "$actual" != "$2" ]]; then | ||
echo "Expected '$2' but got '$actual'" | ||
exit 1 | ||
fi | ||
local actual | ||
actual="$(bash -c "$1")" | ||
if [[ "$actual" != "$2" ]]; then | ||
echo "Expected '$2' but got '$actual'" | ||
exit 1 | ||
fi | ||
} | ||
|
||
assert_contains() { | ||
local actual | ||
actual="$(bash -c "$1")" | ||
if [[ "$actual" != *"$2"* ]]; then | ||
echo "Expected '$2' to be in '$actual'" | ||
exit 1 | ||
fi | ||
local actual | ||
actual="$(bash -c "$1")" | ||
if [[ "$actual" != *"$2"* ]]; then | ||
echo "Expected '$2' to be in '$actual'" | ||
exit 1 | ||
fi | ||
} | ||
|
||
assert_not_contains() { | ||
local actual | ||
actual="$(bash -c "$1")" | ||
if [[ "$actual" == *"$2"* ]]; then | ||
echo "Expected '$2' to not be in '$actual'" | ||
exit 1 | ||
fi | ||
local actual | ||
actual="$(bash -c "$1")" | ||
if [[ "$actual" == *"$2"* ]]; then | ||
echo "Expected '$2' to not be in '$actual'" | ||
exit 1 | ||
fi | ||
} | ||
|
||
assert_fail() { | ||
if bash -c "$1" 2>&1; then | ||
echo "Expected failure but succeeded" | ||
exit 1 | ||
fi | ||
if bash -c "$1" 2>&1; then | ||
echo "Expected failure but succeeded" | ||
exit 1 | ||
fi | ||
} | ||
|
||
assert_matches() { | ||
local actual | ||
actual="$(bash -c "$1")" | ||
if [[ ! "$actual" =~ $2 ]]; then | ||
echo "Expected '$2' to match '$actual'" | ||
exit 1 | ||
fi | ||
local actual | ||
actual="$(bash -c "$1")" | ||
if [[ ! "$actual" =~ $2 ]]; then | ||
echo "Expected '$2' to match '$actual'" | ||
exit 1 | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters