diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index a2f1520..3286b6f 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -107,16 +107,18 @@ run_test_internal() { for ((i=1; i<=${#expected_region_highlight}; i++)); do local -a highlight_zone; highlight_zone=( ${(z)expected_region_highlight[$i]} ) local todo= + integer start=$highlight_zone[1] end=$highlight_zone[2] [[ $highlight_zone[3] == NONE ]] && highlight_zone[3]= [[ -n "$highlight_zone[4]" ]] && todo=" # TODO $highlight_zone[4]" - for j in {$highlight_zone[1]..$highlight_zone[2]}; do + for j in {$start..$end}; do if [[ "$observed_result[$j]" != "$highlight_zone[3]" ]]; then # Escape # as ♯ since the former is illegal in the 'description' part of TAP output - echo "not ok $i ${(qqq)BUFFER[$highlight_zone[1],$highlight_zone[2]]//'#'/♯} [$highlight_zone[1],$highlight_zone[2]]: expected ${(qqq)highlight_zone[3]}, observed ${(qqq)observed_result[$j]}.$todo" + echo "not ok $i ${(qqq)BUFFER[$start,$end]//'#'/♯} [$start,$end]: expected ${(qqq)highlight_zone[3]}, observed ${(qqq)observed_result[$j]}.$todo" continue 2 fi done echo "ok $i$todo" + unset start end unset todo unset highlight_zone done