Skip to content

Commit d5d2f22

Browse files
committed
Revert "test harness: Rewrite the columnar pretty-printer without external tools." and "travis: Remove bsdmainutils since column(1) has been removed, three commits ago."
This reverts commits ea7c165 and 3d81c83. When "have 6 expectations and 4 region_highlight entries", the pure-zsh implementation printed them as follows: not ok 7 - cardinality check - have 6 expectations and 4 region_highlight entries: «expected_region_highlight=( $'1 1 builtin' $'3 6 comment' $'8 13 comment' $'15 15 default' $'16 21 comment' $'22 22 default' )» «region_highlight=( $'0 1 builtin' $'2 6 comment' $'7 13 comment' $'14 22 default' )» # expected_region_highlight '22 22 default' # '1 1 builtin' region_highlight # '3 6 comment' '0 1 builtin' # '8 13 comment' '2 6 comment' # '15 15 default' '7 13 comment' # '16 21 comment' '14 22 default' Whereas the column(1)-based implementation prints them as follows: not ok 7 - cardinality check - have 6 expectations and 4 region_highlight entries: «expected_region_highlight=( $'1 1 builtin' $'3 6 comment' $'8 13 comment' $'15 15 default' $'16 21 comment' $'22 22 default' )» «region_highlight=( $'0 1 builtin' $'2 6 comment' $'7 13 comment' $'14 22 default' )» # expected_region_highlight region_highlight # '1 1 builtin' '0 1 builtin' # '3 6 comment' '2 6 comment' # '8 13 comment' '7 13 comment' # '15 15 default' '14 22 default' # '16 21 comment' # '22 22 default' Ultimately, this difference is down to the pure-zsh implementation getting the arguments as a single list, whereas paste(1) gets two separate lists.
1 parent 8eaa414 commit d5d2f22

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ env:
3535
- ZSH=4.3.12
3636
- ZSH=4.3.11
3737

38-
script: docker run -v $PWD:/work -w /work zshusers/zsh:${ZSH} /bin/sh -c 'install_packages make procps && make test'
38+
script: docker run -v $PWD:/work -w /work zshusers/zsh:${ZSH} /bin/sh -c 'install_packages make procps bsdmainutils && make test'
3939

4040
notifications:
4141
webhooks:

tests/test-highlighting.zsh

+4-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ run_test_internal() {
230230
if (( difference > 0 )); then
231231
left_column+=( ${(r:2*difference::. :):-} )
232232
fi
233-
print -rC2 -- "${left_column[@]}" "${right_column[@]}" \
233+
paste \
234+
=(print -rC1 -- $left_column) \
235+
=(print -rC1 -- $right_column) \
236+
| if type column >/dev/null; then column -t -s $'\t'; else cat; fi \
234237
| sed 's/^/# /'
235238
}
236239
fi

0 commit comments

Comments
 (0)