From fac792dc2714aa5a5d0d44aeacd7c53578486aae Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 2 Apr 2019 11:11:19 +0100 Subject: [PATCH] Update regress from master. --- regress/Makefile | 1 + regress/control-client-size.sh | 4 ++-- regress/cursor-test.txt | 6 +++++ regress/cursor-test1.result | 33 ++++++++++++++++++++++++++++ regress/cursor-test1.sh | 29 ++++++++++++++++++++++++ regress/cursor-test2.result | 33 ++++++++++++++++++++++++++++ regress/cursor-test2.sh | 29 ++++++++++++++++++++++++ regress/cursor-test3.result | 9 ++++++++ regress/cursor-test3.sh | 29 ++++++++++++++++++++++++ regress/cursor-test4.result | 16 ++++++++++++++ regress/cursor-test4.sh | 31 ++++++++++++++++++++++++++ regress/kill-session-process-exit.sh | 4 ++-- 12 files changed, 220 insertions(+), 4 deletions(-) create mode 100644 regress/cursor-test.txt create mode 100644 regress/cursor-test1.result create mode 100644 regress/cursor-test1.sh create mode 100644 regress/cursor-test2.result create mode 100644 regress/cursor-test2.sh create mode 100644 regress/cursor-test3.result create mode 100644 regress/cursor-test3.sh create mode 100644 regress/cursor-test4.result create mode 100644 regress/cursor-test4.sh diff --git a/regress/Makefile b/regress/Makefile index 3775a711..e6c3619f 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -7,3 +7,4 @@ all: $(TESTS) $(TESTS): sh $*.sh + sleep 1 diff --git a/regress/control-client-size.sh b/regress/control-client-size.sh index b8d9aef0..dd1850c5 100644 --- a/regress/control-client-size.sh +++ b/regress/control-client-size.sh @@ -28,7 +28,7 @@ $TMUX kill-server 2>/dev/null $TMUX -f/dev/null new -d || exit 1 sleep 1 -cat <$TMP +cat <$TMP ls -F':#{window_width} #{window_height}' refresh -C 80,24 ls -F':#{window_width} #{window_height}' @@ -37,7 +37,7 @@ grep ^: $TMP >$OUT printf ":80 24\n:80 23\n"|cmp -s $OUT - || exit 1 $TMUX kill-server 2>/dev/null -cat <$TMP +cat <$TMP ls -F':#{window_width} #{window_height}' refresh -C 80,24 ls -F':#{window_width} #{window_height}' diff --git a/regress/cursor-test.txt b/regress/cursor-test.txt new file mode 100644 index 00000000..67ed52c8 --- /dev/null +++ b/regress/cursor-test.txt @@ -0,0 +1,6 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor +incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea +commodo consequat. Duis aute +irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat +nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia +deserunt mollit anim id est laborum. diff --git a/regress/cursor-test1.result b/regress/cursor-test1.result new file mode 100644 index 00000000..71b9a4b6 --- /dev/null +++ b/regress/cursor-test1.result @@ -0,0 +1,33 @@ +14 8 t +0 ud exercitation ullamco laboris nisi ut +1 aliquip ex ea +2 commodo consequat. Duis aute +3 irure dolor in reprehenderit in voluptat +4 e velit esse cillum dolore eu fugiat +5 nulla pariatur. Excepteur sint occaecat +6 cupidatat non proident, sunt in culpa qu +7 i officia +8 deserunt mollit anim id est laborum. +9 +4 6 t +0 cupidatat +1 non proide +2 nt, sunt i +3 n culpa qu +4 i officia +5 deserunt m +6 ollit anim +7 id est la +8 borum. +9 +14 8 t +0 incididunt ut labore et dolore magna aliqua. Ut en +1 im ad minim veniam, quis nostrud exercitation ulla +2 mco laboris nisi ut aliquip ex ea +3 commodo consequat. Duis aute +4 irure dolor in reprehenderit in voluptate velit es +5 se cillum dolore eu fugiat +6 nulla pariatur. Excepteur sint occaecat cupidatat +7 non proident, sunt in culpa qui officia +8 deserunt mollit anim id est laborum. +9 diff --git a/regress/cursor-test1.sh b/regress/cursor-test1.sh new file mode 100644 index 00000000..2dc20539 --- /dev/null +++ b/regress/cursor-test1.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +PATH=/bin:/usr/bin +TERM=screen + +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) +TMUX="$TEST_TMUX -f/dev/null -Ltest" +$TMUX kill-server 2>/dev/null + +TMP=$(mktemp) +trap "rm -f $TMP" 0 1 15 + +$TMUX -f/dev/null new -d -x40 -y10 \ + "cat cursor-test.txt; printf '\e[9;15H'; cat" || exit 1 +$TMUX set -g window-size manual || exit 1 + +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x10 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x50 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP + +cmp -s $TMP cursor-test1.result || exit 1 + +$TMUX kill-server 2>/dev/null +exit 0 diff --git a/regress/cursor-test2.result b/regress/cursor-test2.result new file mode 100644 index 00000000..dc005d2b --- /dev/null +++ b/regress/cursor-test2.result @@ -0,0 +1,33 @@ +9 7 a +0 cupidatat +1 non proide +2 nt, sunt i +3 n culpa qu +4 i officia +5 deserunt m +6 ollit anim +7 id est la +8 borum. +9 +4 6 a +0 icia +1 deser +2 unt m +3 ollit +4 anim +5 id e +6 st la +7 borum +8 . +9 +29 8 a +0 incididunt ut labore et dolore magna aliqua. Ut en +1 im ad minim veniam, quis nostrud exercitation ulla +2 mco laboris nisi ut aliquip ex ea +3 commodo consequat. Duis aute +4 irure dolor in reprehenderit in voluptate velit es +5 se cillum dolore eu fugiat +6 nulla pariatur. Excepteur sint occaecat cupidatat +7 non proident, sunt in culpa qui officia +8 deserunt mollit anim id est laborum. +9 diff --git a/regress/cursor-test2.sh b/regress/cursor-test2.sh new file mode 100644 index 00000000..9791f567 --- /dev/null +++ b/regress/cursor-test2.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +PATH=/bin:/usr/bin +TERM=screen + +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) +TMUX="$TEST_TMUX -Ltest" +$TMUX kill-server 2>/dev/null + +TMP=$(mktemp) +trap "rm -f $TMP" 0 1 15 + +$TMUX -f/dev/null new -d -x10 -y10 \ + "cat cursor-test.txt; printf '\e[8;10H'; cat" || exit 1 +$TMUX set -g window-size manual || exit 1 + +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x5 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x50 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP + +cmp -s $TMP cursor-test2.result || exit 1 + +$TMUX kill-server 2>/dev/null +exit 0 diff --git a/regress/cursor-test3.result b/regress/cursor-test3.result new file mode 100644 index 00000000..e72b1a9b --- /dev/null +++ b/regress/cursor-test3.result @@ -0,0 +1,9 @@ +6 1 b +0 abcdefa +1 bcdefab +3 1 b +0 fabcd +1 efab +6 1 b +0 abcdefa +1 bcdefab diff --git a/regress/cursor-test3.sh b/regress/cursor-test3.sh new file mode 100644 index 00000000..8bb4bd6f --- /dev/null +++ b/regress/cursor-test3.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +PATH=/bin:/usr/bin +TERM=screen + +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) +TMUX="$TEST_TMUX -Ltest" +$TMUX kill-server 2>/dev/null + +TMP=$(mktemp) +trap "rm -f $TMP" 0 1 15 + +$TMUX -f/dev/null new -d -x7 -y2 \ + "printf 'abcdefabcdefab'; printf '\e[2;7H'; cat" || exit 1 +$TMUX set -g window-size manual || exit 1 + +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x5 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x7 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP + +cmp -s $TMP cursor-test3.result || exit 1 + +$TMUX kill-server 2>/dev/null +exit 0 diff --git a/regress/cursor-test4.result b/regress/cursor-test4.result new file mode 100644 index 00000000..db26e4fa --- /dev/null +++ b/regress/cursor-test4.result @@ -0,0 +1,16 @@ +0 1 +0 abcdef +1 +2 +0 1 +0 abcdef +1 +2 +0 1 +0 def +1 +2 +0 1 +0 abcdef +1 +2 diff --git a/regress/cursor-test4.sh b/regress/cursor-test4.sh new file mode 100644 index 00000000..2bf1bb0e --- /dev/null +++ b/regress/cursor-test4.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +PATH=/bin:/usr/bin +TERM=screen + +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) +TMUX="$TEST_TMUX -Ltest" +$TMUX kill-server 2>/dev/null + +TMP=$(mktemp) +trap "rm -f $TMP" 0 1 15 + +$TMUX -f/dev/null new -d -x10 -y3 "printf 'abcdef\n'; cat" || exit 1 +$TMUX set -g window-size manual || exit 1 + +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x20 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x3 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP +$TMUX resizew -x10 || exit 1 +$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP +$TMUX capturep -p|awk '{print NR-1,$0}' >>$TMP + +cmp -s $TMP cursor-test4.result || exit 1 + +$TMUX kill-server 2>/dev/null +exit 0 diff --git a/regress/kill-session-process-exit.sh b/regress/kill-session-process-exit.sh index 27d883e2..69ee27a2 100644 --- a/regress/kill-session-process-exit.sh +++ b/regress/kill-session-process-exit.sh @@ -9,9 +9,9 @@ TERM=screen TMUX="$TEST_TMUX -Ltest" $TMUX kill-server 2>/dev/null -$TMUX new -d 'sleep 1000' || exit 1 +$TMUX -f/dev/null new -d 'sleep 1000' || exit 1 P=$($TMUX display -pt0:0.0 '#{pane_pid}') -$TMUX new -d || exit 1 +$TMUX -f/dev/null new -d || exit 1 sleep 1 $TMUX kill-session -t0: sleep 1