From f83bca0847a66a1a8ca308fab10cd0f1090ff32e Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 5 May 2016 18:48:59 +0000 Subject: [PATCH] minor: tests: Introduce a local variable. No functional change. --- tests/test-highlighting.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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