Skip to content

Commit eda74cc

Browse files
committed
style: fix indentation from 8 spaces to 2 in acceptance tests and console_header
1 parent 172026f commit eda74cc

78 files changed

Lines changed: 1553 additions & 1551 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/assert.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ function assert_false() {
8383
function bashunit::run_command_or_eval() {
8484
local cmd="$1"
8585

86-
if bashunit::regex_match "$cmd" '^eval'; then
86+
local _re='^eval'
87+
if [[ "$cmd" =~ $_re ]]; then
8788
eval "${cmd#eval }" &>/dev/null
88-
elif bashunit::regex_match "$(command -v "$cmd")" '^alias'; then
89+
else
90+
_re='^alias'
91+
if [[ "$(command -v "$cmd")" =~ $_re ]]; then
8992
eval "$cmd" &>/dev/null
9093
else
9194
"$cmd" &>/dev/null
@@ -306,7 +309,7 @@ function assert_matches() {
306309
local actual
307310
actual=$(printf '%s\n' "${actual_arr[@]}")
308311

309-
if ! bashunit::regex_match "$actual" "$expected"; then
312+
if ! [[ "$actual" =~ $expected ]]; then
310313
local test_fn
311314
test_fn="$(bashunit::helper::find_test_function_name)"
312315
local label
@@ -328,7 +331,7 @@ function assert_not_matches() {
328331
local actual
329332
actual=$(printf '%s\n' "${actual_arr[@]}")
330333

331-
if bashunit::regex_match "$actual" "$expected"; then
334+
if [[ "$actual" =~ $expected ]]; then
332335
local test_fn
333336
test_fn="$(bashunit::helper::find_test_function_name)"
334337
local label

src/clock.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ function bashunit::clock::_choose_impl() {
4545
if ! bashunit::check_os::is_macos && ! bashunit::check_os::is_alpine; then
4646
local result
4747
result=$(date +%s%N 2>/dev/null)
48-
if [[ "$result" != *N ]] && bashunit::regex_match "$result" '^[0-9]+$'; then
48+
local _re='^[0-9]+$'
49+
if [[ "$result" != *N ]] && [[ "$result" =~ $_re ]]; then
4950
_BASHUNIT_CLOCK_NOW_IMPL="date"
5051
return 0
5152
fi

0 commit comments

Comments
 (0)