Skip to content

Commit 9ba1cc7

Browse files
committed
bench: run bc just once, exit cleanly unless the syntax was never run
1 parent caaf911 commit 9ba1cc7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/bench

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ for sample in "$@"; do
88
run=$(awk '/\/after\/syntax\/css\.vim$/ {sum += $2} END {print sum}' "$s")
99
rm $s
1010
echo "$run${multi:+\t$sample}"
11-
total=$(echo "${total:-0} + ${run:-0}" |bc -ql)
11+
total="${total:-0} + ${run:-0}"
1212
done
13-
[ -n "$multi" ] && echo "$total\t(total)"
13+
# if multi, show the sum total. otherwise, return true only if we had a run.
14+
[ -n "$multi" ] && echo "$(echo "$total" |bc -ql)\t(total)" || [ -n "$run" ]

0 commit comments

Comments
 (0)