File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -465,8 +465,8 @@ function bashunit::coverage::get_executable_lines() {
465465 local line
466466
467467 while IFS= read -r line || [ -n " $line " ]; do
468- (( lineno ++ ))
469- bashunit::coverage::is_executable_line " $line " " $lineno " && (( count ++ ))
468+ (( ++ lineno ))
469+ bashunit::coverage::is_executable_line " $line " " $lineno " && (( ++ count ))
470470 done < " $file "
471471
472472 echo " $count "
@@ -498,7 +498,7 @@ function bashunit::coverage::get_hit_lines() {
498498 local line_content
499499 line_content=$( sed -n " ${line_num} p" " $file " 2> /dev/null) || continue
500500 if bashunit::coverage::is_executable_line " $line_content " " $line_num " ; then
501- (( count ++ ))
501+ (( ++ count ))
502502 fi
503503 done
504504
@@ -565,7 +565,7 @@ function bashunit::coverage::extract_functions() {
565565 local line
566566
567567 while IFS= read -r line || [ -n " $line " ]; do
568- (( lineno ++ ))
568+ (( ++ lineno ))
569569
570570 # Check for function definition patterns
571571 # Pattern 1: function name() { or function name {
@@ -644,10 +644,10 @@ function bashunit::coverage::get_function_coverage() {
644644 line_content=$( sed -n " ${lineno} p" " $file " 2> /dev/null) || continue
645645
646646 if bashunit::coverage::is_executable_line " $line_content " " $lineno " ; then
647- (( executable ++ ))
647+ (( ++ executable ))
648648 local line_hits=${_hits_ref[$lineno]:- 0}
649649 if [ " $line_hits " -gt 0 ]; then
650- (( hit ++ ))
650+ (( ++ hit ))
651651 fi
652652 fi
653653 done
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ function bashunit::learn::show_progress() {
127127 for i in $( seq 1 $total_lessons ) ; do
128128 if bashunit::learn::is_completed " lesson_$i " ; then
129129 echo " ${_BASHUNIT_COLOR_PASSED} ✓${_BASHUNIT_COLOR_DEFAULT} Lesson $i completed"
130- (( completed ++ )) || true
130+ (( ++ completed )) || true
131131 else
132132 echo " ${_BASHUNIT_COLOR_INCOMPLETE} ○${_BASHUNIT_COLOR_DEFAULT} Lesson $i "
133133 fi
Original file line number Diff line number Diff line change @@ -40,17 +40,17 @@ function bashunit::str::rpad() {
4040 if [ " $original_char " = $' \x1b ' ]; then
4141 while [ " ${left_text: $j : 1} " != " m" ] && [ $j -lt ${# left_text} ]; do
4242 result_left_text=" $result_left_text ${left_text: $j : 1} "
43- (( j ++ ))
43+ (( ++ j ))
4444 done
4545 result_left_text=" $result_left_text ${left_text: $j : 1} " # Append the final 'm'
46- (( j ++ ))
46+ (( ++ j ))
4747 elif [ " $char " = " $original_char " ]; then
4848 # Match the actual character
4949 result_left_text=" $result_left_text$char "
50- (( i ++ ))
51- (( j ++ ))
50+ (( ++ i ))
51+ (( ++ j ))
5252 else
53- (( j ++ ))
53+ (( ++ j ))
5454 fi
5555 done
5656
You can’t perform that action at this time.
0 commit comments