Kaynağa Gözat

minor: tests: Introduce a local variable. No functional change.

pull/309/head
Daniel Shahaf 8 yıl önce
ebeveyn
işleme
f83bca0847
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. +4
    -2
      tests/test-highlighting.zsh

+ 4
- 2
tests/test-highlighting.zsh Dosyayı Görüntüle

@ -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

Yükleniyor…
İptal
Kaydet