From c948a3caa0daa201c58dd9e24f2d1de9b6666f45 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Sat, 4 Nov 2017 11:18:31 -0500 Subject: [PATCH] tests: Declare local variables --- tests/test-highlighting.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index 743b3bb..a9210ae 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -97,7 +97,8 @@ run_test_internal() { echo "# ${1:t:r}" # Load the data and prepare checking it. - PREBUFFER= BUFFER= ; + local BUFFER CURSOR MARK PENDING PREBUFFER REGION_ACTIVE WIDGET + local -a expected_region_highlight region_highlight . "$srcdir"/"$1" # Check the data declares $PREBUFFER or $BUFFER. @@ -109,11 +110,11 @@ run_test_internal() { : ${CURSOR=$#BUFFER} ${PENDING=0} ${WIDGET=z-sy-h-test-harness-test-widget} # Process the data. - region_highlight=() _zsh_highlight # Overlapping regions can be declared in region_highlight, so we first build an array of the # observed highlighting. + local i j local -A observed_result for ((i=1; i<=${#region_highlight}; i++)); do local -a highlight_zone; highlight_zone=( ${(z)region_highlight[$i]} )