Use printf not echo -e, from Joyce Lin.

This commit is contained in:
Nicholas Marriott 2024-05-13 12:42:14 +01:00
parent 3823fa2c57
commit 9ba433e521
2 changed files with 9 additions and 9 deletions

View File

@ -42,14 +42,14 @@ $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word-end $TMUX send-keys -X next-word-end
$TMUX send-keys -X next-word-end $TMUX send-keys -X next-word-end
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "words\n Indented")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "words\n Indented")" ] || exit 1
# Test that `next-word` wraps around un-indented line breaks. # Test that `next-word` wraps around un-indented line breaks.
$TMUX send-keys -X next-word $TMUX send-keys -X next-word
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word $TMUX send-keys -X next-word
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "line\n")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "line\n")" ] || exit 1
# Test that `next-word-end` treats periods as letters. # Test that `next-word-end` treats periods as letters.
$TMUX send-keys -X next-word $TMUX send-keys -X next-word
@ -63,14 +63,14 @@ $TMUX send-keys -X previous-word
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word $TMUX send-keys -X next-word
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "line...\n")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "line...\n")" ] || exit 1
# Test that `previous-space` and `next-space` treat periods as letters. # Test that `previous-space` and `next-space` treat periods as letters.
$TMUX send-keys -X previous-space $TMUX send-keys -X previous-space
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-space $TMUX send-keys -X next-space
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "line...\n")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "line...\n")" ] || exit 1
# Test that `next-word` and `next-word-end` treat other symbols as letters. # Test that `next-word` and `next-word-end` treat other symbols as letters.
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
@ -87,7 +87,7 @@ $TMUX send-keys -X previous-word
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word $TMUX send-keys -X next-word
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "\$ym_bols[]{}\n ")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "\$ym_bols[]{}\n ")" ] || exit 1
# Test that `next-word-end` treats digits as letters # Test that `next-word-end` treats digits as letters
$TMUX send-keys -X next-word-end $TMUX send-keys -X next-word-end

View File

@ -41,14 +41,14 @@ $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word-end $TMUX send-keys -X next-word-end
$TMUX send-keys -X next-word-end $TMUX send-keys -X next-word-end
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "words\n Indented")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "words\n Indented")" ] || exit 1
# Test that `next-word` wraps around un-indented line breaks. # Test that `next-word` wraps around un-indented line breaks.
$TMUX send-keys -X next-word $TMUX send-keys -X next-word
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-word $TMUX send-keys -X next-word
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "line\nA")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "line\nA")" ] || exit 1
# Test that `next-word-end` does not treat periods as letters. # Test that `next-word-end` does not treat periods as letters.
$TMUX send-keys -X next-word $TMUX send-keys -X next-word
@ -69,7 +69,7 @@ $TMUX send-keys -X previous-space
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-space $TMUX send-keys -X next-space
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "line...\n.")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "line...\n.")" ] || exit 1
# Test that `next-word` and `next-word-end` do not treat other symbols as letters. # Test that `next-word` and `next-word-end` do not treat other symbols as letters.
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
@ -85,7 +85,7 @@ $TMUX send-keys -X next-space
$TMUX send-keys -X begin-selection $TMUX send-keys -X begin-selection
$TMUX send-keys -X next-space $TMUX send-keys -X next-space
$TMUX send-keys -X copy-selection $TMUX send-keys -X copy-selection
[ "$($TMUX show-buffer)" = "$(echo -e "\$ym_bols[]{}\n ?")" ] || exit 1 [ "$($TMUX show-buffer)" = "$(printf "\$ym_bols[]{}\n ?")" ] || exit 1
# Test that `next-word-end` treats digits as letters # Test that `next-word-end` treats digits as letters
$TMUX send-keys -X next-word-end $TMUX send-keys -X next-word-end