aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-01-02 23:32:38 +0100
committerBoris Faure <billiob@gmail.com>2019-01-02 23:32:38 +0100
commit0ca634cd698006eba8f9235fc0e6df4df14c7f90 (patch)
tree52dab7e655fea55c13140df215aaaf7802f7139b /tests
parenttermptyesc: move ED handler to its own functions + add tests (diff)
downloadterminology-0ca634cd698006eba8f9235fc0e6df4df14c7f90.tar.gz
termptyesc: export EL handler to its own function + add tests
Diffstat (limited to 'tests')
-rwxr-xr-xtests/el.sh74
-rw-r--r--tests/tests.results1
2 files changed, 75 insertions, 0 deletions
diff --git a/tests/el.sh b/tests/el.sh
new file mode 100755
index 0000000..9587727
--- /dev/null
+++ b/tests/el.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+# fill space
+PL=0
+for _ in $(seq 0 23); do
+ PL=$((PL+1))
+ if [ $PL -ge 9 ] ; then
+ PL=0
+ fi
+ for _ in $(seq 1 $PL); do
+ printf '#'
+ done
+ PR=$((10 - PL))
+ for _ in $(seq 0 6); do
+ printf '\033[0;1m\-'
+ printf '\033[0;46;1;4m/'
+ printf '\033[0;46;1;4m|'
+ printf '\033[0;1;4;7m\\'
+ printf '\033[0m~'
+ printf '\033[0;1m_'
+ printf '\033[0;31;7m>'
+ printf '\033[0;31;4;7m^'
+ printf '\033[0;1;7m<'
+ done
+ printf '\033[0m'
+ for _ in $(seq 1 $PR); do
+ printf '#'
+ done
+done
+
+
+# set color
+printf '\033[43;32;3m'
+
+# set top/bottom margins:
+printf '\033[3;20r'
+# allow left/right margins
+printf '\033[?69h'
+# set left/right margins:
+printf '\033[5;75s'
+
+# restrict cursor
+printf '\033[?6h'
+
+printf '\033[3;30H#'
+# move
+printf '\033[4;30H#\033[4;30H'
+# EL 0 -> Erase Line Right
+printf '\033[0K'
+# move
+printf '\033[5;30H#\033[5;30H'
+# EL 0 (default) -> Erase Line Right
+printf '\033[K'
+
+printf '\033[6;30H#'
+
+# move
+printf '\033[7;30H#\033[7;30H'
+# EL 1 -> Erase Line Left
+printf '\033[1K'
+
+printf '\033[8;30H#'
+
+# move
+printf '\033[9;30H#\033[9;30H'
+# EL 2 -> Erase Complete Line
+printf '\033[2K'
+
+printf '\033[10;30H#'
+
+# move
+printf '\033[11;30H#\033[11;30H'
+# EL 3 -> Nothing
+printf '\033[3K'
diff --git a/tests/tests.results b/tests/tests.results
index e104152..e064dae 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -57,3 +57,4 @@ ed-1.sh 399897d5dd697adea2cc460ca6132826
ed-2.sh 82e7919a46fdea3a003143b41562b148
ed-3.sh 005871b7e4d63017c08a73ab34f99b14
ed-4.sh 574f37ac24ead26ef86c03d7dfae3152
+el.sh abca9d5e5990bed6bd72a7ab9f72b849