From 07bc90c34cc6882caf8bc8a76205690b23030132 Mon Sep 17 00:00:00 2001 From: pgen Date: Sat, 25 Mar 2023 15:18:31 +0100 Subject: Add tests for the alignment feature Also add an note about the use of ptylie with new Linux kernels. --- tests/README.rst | 3 +++ tests/alignments/data1 | 3 +++ tests/alignments/data2 | 18 ++++++++++++++++++ tests/alignments/t0001.good | 15 +++++++++++++++ tests/alignments/t0001.in | 1 + tests/alignments/t0001.tst | 4 ++++ tests/alignments/t0002.good | 19 +++++++++++++++++++ tests/alignments/t0002.in | 1 + tests/alignments/t0002.tst | 4 ++++ 9 files changed, 68 insertions(+) create mode 100644 tests/alignments/data1 create mode 100644 tests/alignments/data2 create mode 100644 tests/alignments/t0001.good create mode 120000 tests/alignments/t0001.in create mode 100644 tests/alignments/t0001.tst create mode 100644 tests/alignments/t0002.good create mode 120000 tests/alignments/t0002.in create mode 100644 tests/alignments/t0002.tst (limited to 'tests') diff --git a/tests/README.rst b/tests/README.rst index 040a741..e15b851 100644 --- a/tests/README.rst +++ b/tests/README.rst @@ -16,6 +16,9 @@ before going any further. The resulting output is the content of the screen after all the typescript content and DEC escape sequences have been interpreted. + With newer Linux kernelsi (>= 6.2), you may need to run (as root) + ``sysctl dev.tty.legacy_tiocsti=1`` for this to work. + - For accurate results, please use a terminal using DEC escape sequences for attribute settings (colors, bold...). As most tests are using colors and UTF-8 the terminal and locale in use must support them. Setting and diff --git a/tests/alignments/data1 b/tests/alignments/data1 new file mode 100644 index 0000000..f6190fe --- /dev/null +++ b/tests/alignments/data1 @@ -0,0 +1,3 @@ +'a ' ' b c d' 'e f ' ' g h i' +a b 'c d' e f g ' h i' +' a ' b c d e f g h i diff --git a/tests/alignments/data2 b/tests/alignments/data2 new file mode 100644 index 0000000..c554511 --- /dev/null +++ b/tests/alignments/data2 @@ -0,0 +1,18 @@ +Number "Kanji symbol" Sino-Japanese 'English pronunciation' +100 百 ひゃく hyaku +200 二百 にひゃく ni-hyaku +300 三百 さんびゃく san-byaku +400 四百 よんひゃく yon-hyaku +500 五百 ごひゃく go-hyaku +600 六百 ろっぴゃく roppyaku +700 七百 ななひゃく nana-hyaku +800 八百 はっぴゃく happyaku +900 九百 きゅうひゃく kyuu-hyaku +1000 千 せん sen +10,000 一万 いちまん ichi-man +100,000 十万 じゅうまん juu-man +"1 million" 百万 ひゃくまん hyaku-man +"10 million" 千万 せんまん sen-man +"100 million" 億 おく oku +"1 billion" 十億 じゅうおく juu-oku +"1 trillion" 兆 ちょう chou diff --git a/tests/alignments/t0001.good b/tests/alignments/t0001.good new file mode 100644 index 0000000..7c8f7fa --- /dev/null +++ b/tests/alignments/t0001.good @@ -0,0 +1,15 @@ +$ OUT=$(smenu -c -g: -Cr1,3-4 -Rl/'c d'/ -- t0001.in) + + a : b c d:e f : g h i +0:07 1:07 2:07 + a:b :c d :e :f:g: h i + + a :b : c: d:e:f:g :h:i + +$ + +$ echo ":$OUT:" + +:a: + +$ exit 0 diff --git a/tests/alignments/t0001.in b/tests/alignments/t0001.in new file mode 120000 index 0000000..0abc8f1 --- /dev/null +++ b/tests/alignments/t0001.in @@ -0,0 +1 @@ +data1 \ No newline at end of file diff --git a/tests/alignments/t0001.tst b/tests/alignments/t0001.tst new file mode 100644 index 0000000..b4b1aca --- /dev/null +++ b/tests/alignments/t0001.tst @@ -0,0 +1,4 @@ +\S[150]\s[10]OUT=$(smenu -c -g: -Cr1,3-4 -Rl/'c d'/ -- t0001.in) +\S[150]\s[50]\r +\S[150]\s[10]echo ":$\s[10]OUT:" +exit 0 diff --git a/tests/alignments/t0002.good b/tests/alignments/t0002.good new file mode 100644 index 0000000..cddf925 --- /dev/null +++ b/tests/alignments/t0002.good @@ -0,0 +1,19 @@ +$ OUT=$(smenu -c -g: -Re1 -Rc1 -C r1 -Cc/\\ue799be/,3 -- t0002.in) + + Number :Kanji symbol:Sino-Japanese:English pronunciation ┐ +0:24 1:24 2:24 3:24 4:24 5:24 6:24 7:24 8:24 9:24 10:24 12:24 13:24 14:24 15:24 16:24 17:24 18:24 19:24 20:24 21:24 22:24 23:24 25:24 26:24 27:24 28:24 29:24 30:24 31:24 32:24 33:24 34:24 35:24 36:24 37:24 39:24 40:24 41:24 42:24 43:24 44:24 45:24 46:24 47:24 48:24 49:24 50:24 51:24 52:24 53:24 54:24 55:24 56:24 57:24 58:24 59:24 62:20 + 100: 百 : ひゃく :hyaku █ +0:07 1:07 2:07 3:07 4:07 5:07 6:07 7:07 8:07 9:07 10:07 62:20 + 200: 二百 : にひゃく :ni-hyaku │ +62:20 + 300: 三百 : さんびゃく :san-byaku │ +62:20 + 400: 四百 : よんひゃく :yon-hyaku ▼ +62:20 +$ + +$ echo ":$OUT:" + +:100: + +$ exit 0 diff --git a/tests/alignments/t0002.in b/tests/alignments/t0002.in new file mode 120000 index 0000000..fee93d1 --- /dev/null +++ b/tests/alignments/t0002.in @@ -0,0 +1 @@ +data2 \ No newline at end of file diff --git a/tests/alignments/t0002.tst b/tests/alignments/t0002.tst new file mode 100644 index 0000000..8c039dc --- /dev/null +++ b/tests/alignments/t0002.tst @@ -0,0 +1,4 @@ +\S[150]\s[10]OUT=$(smenu -c -g: -Re1 -Rc1 -C r1 -Cc/\\\\ue799be/,3 -- t0002.in) +\S[150]\s[50]\r +\S[150]\s[10]echo ":$\s[10]OUT:" +exit 0 -- cgit v1.2.3