File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed
Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5- - Fix build issue with bashunit on NixOS
5+ - Fix parallel and ` compgen ` issue on NixOS
66
77## [ 0.22.2] ( https://github.com/TypedDevs/bashunit/compare/0.22.1...0.22.2 ) - 2025-07-26
88
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- if dependencies::has_bc; then
4- # bc is better than awk because bc has no integer limits.
5- function math::calculate() {
3+ function math::calculate() {
4+ if dependencies::has_bc; then
65 echo " $* " | bc
7- }
8- elif dependencies::has_awk; then
9- function math::calculate() {
10- awk " BEGIN { print " " $* " " }"
11- }
12- fi
6+ elif dependencies::has_awk; then
7+ awk " BEGIN { print ($* ) }"
8+ else
9+ local result=$(( $* ))
10+ echo " $result "
11+ fi
12+ }
Original file line number Diff line number Diff line change @@ -12,12 +12,16 @@ function parallel::aggregate_test_results() {
1212 local total_snapshot=0
1313
1414 for script_dir in " $temp_dir_parallel_test_suite " /* ; do
15- if ! compgen -G " $script_dir " /* .result > /dev/null; then
15+ shopt -s nullglob
16+ local result_files=(" $script_dir " /* .result)
17+ shopt -u nullglob
18+
19+ if [ ${# result_files[@]} -eq 0 ]; then
1620 printf " %sNo tests found%s" " $_COLOR_SKIPPED " " $_COLOR_DEFAULT "
1721 continue
1822 fi
1923
20- for result_file in " $script_dir " / * .result ; do
24+ for result_file in " ${result_files[@]} " ; do
2125 local result_line
2226 result_line=$( tail -n 1 " $result_file " )
2327
You can’t perform that action at this time.
0 commit comments