-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test get tw config value with assert
- Loading branch information
1 parent
4d56ecb
commit 7a60f7c
Showing
2 changed files
with
31 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# compare two strings and ensure they match or crash | ||
# matching node order of actual, expected, [message] https://nodejs.org/api/assert.html#assertequalactual-expected-message | ||
# matching rust order of actual, expexted https://users.rust-lang.org/t/assert-eq-expected-and-actual/20304/3 | ||
# | ||
# @param actual | ||
# @param expected | ||
# @param [message] | ||
assert_eq() { | ||
local actual="$1" | ||
local expected="$2" | ||
local message="${3:-}" | ||
[ "$actual" = "$expected" ] && return | ||
|
||
printf 'assertion error! %s\n' "$message" 1>&2 | ||
printf ' expected: %s\n' "$expected" 1>&2 | ||
printf ' got: %s\n' "$actual" 1>&2 | ||
} | ||
|
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