tests: Support non-arrays in typeset_p().
This commit is contained in:
parent
f729726300
commit
dc70e89bfd
@ -93,9 +93,13 @@ ZSH_HIGHLIGHT_HIGHLIGHTERS=($1)
|
|||||||
|
|
||||||
# In zsh<5.3, 'typeset -p arrayvar' emits two lines, so we use this wrapper instead.
|
# In zsh<5.3, 'typeset -p arrayvar' emits two lines, so we use this wrapper instead.
|
||||||
typeset_p() {
|
typeset_p() {
|
||||||
for 1 ; do
|
for 1 ; do
|
||||||
print -r -- "$1=( ${(@q-P)1} )"
|
if [[ ${(tP)1} == *array* ]]; then
|
||||||
done
|
print -r -- "$1=( ${(@q-P)1} )"
|
||||||
|
else
|
||||||
|
print -r -- "$1=${(q-P)1}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Escape # as ♯ and newline as ↵ they are illegal in the 'description' part of TAP output
|
# Escape # as ♯ and newline as ↵ they are illegal in the 'description' part of TAP output
|
||||||
|
Loading…
Reference in New Issue
Block a user