瀏覽代碼

tests: Declare local variables

pull/452/head
Matthew Martin 6 年之前
父節點
當前提交
c948a3caa0
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      tests/test-highlighting.zsh

+ 3
- 2
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]} )

Loading…
取消
儲存