File: 05-scrolling.t

package info (click to toggle)
libterm-vt102-perl 0.91-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 268 kB
  • sloc: perl: 2,471; makefile: 13
file content (132 lines) | stat: -rw-r--r-- 2,797 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/perl -w
#
# Make sure the VT102 module can handle scrolling up and down.
#
# Copyright (C) Andrew Wood
# NO WARRANTY - see COPYING.
#

require Term::VT102;
require 't/testbase';

my $fill = "0123456789\r\n" .
           "1234567890\r\n" .
           "2345678901\r\n" .
           "3456789012\e[H";
my $fill2 = "0123456789\r\n" .
            "1234567890\r\n" .
            "2345678901\r\n" .
            "3456789012\e[2;3r\e[2H";

run_tests ([(
  [ 10, 4, $fill . "",				# 1: nothing
    "0123456789",
    "1234567890",
    "2345678901",
    "3456789012",
  ],
  [ 10, 4, $fill . "\e[4H\ntest",		# 2: LF
    "1234567890",
    "2345678901",
    "3456789012",
    "test" . ("\0" x 6),
  ],
  [ 10, 4, $fill . "\eMtest",			# 3: RI
    "test" . ("\0" x 6),
    "0123456789",
    "1234567890",
    "2345678901",
  ],
  [ 10, 4, $fill . "\e[4H\eDtest",		# 4: IND
    "1234567890",
    "2345678901",
    "3456789012",
    "test" . ("\0" x 6),
  ],
  [ 10, 4, $fill . "\e[4H\eEtest",		# 5: NEL
    "1234567890",
    "2345678901",
    "3456789012",
    "test" . ("\0" x 6),
  ],
  [ 10, 4, $fill . "\e[2Atest",			# 6: CUU
    "test" . ("\0" x 6),
    "\0" x 10,
    "0123456789",
    "1234567890",
  ],
  [ 10, 4, $fill . "\e[8Atest",			# 7: CUU
    "test" . ("\0" x 6),
    "\0" x 10,
    "\0" x 10,
    "\0" x 10,
  ],
  [ 10, 4, $fill . "\e[4H\e[2Btest",		# 8: CUD
    "2345678901",
    "3456789012",
    "\0" x 10,
    "test" . ("\0" x 6),
  ],
  [ 10, 4, $fill . "\e[4H\e[2Etest",		# 9: CNL
    "2345678901",
    "3456789012",
    "\0" x 10,
    "test" . ("\0" x 6),
  ],
  [ 10, 4, $fill . "\e[4H\e[9Etest",		# 10: CNL
    "\0" x 10,
    "\0" x 10,
    "\0" x 10,
    "test" . ("\0" x 6),
  ],
  [ 10, 4, $fill . "\e[2Ftest",			# 11: CPL
    "test" . ("\0" x 6),
    "\0" x 10,
    "0123456789",
    "1234567890",
  ],
  [ 10, 4, $fill2 . "",				# 12: nothing (with DECSTBM)
    "0123456789",
    "1234567890",
    "2345678901",
    "3456789012",
  ],
  [ 10, 4, $fill2 . "\e[3H\e[Etest",		# 13: DECSTBM CNL
    "0123456789",
    "2345678901",
    "test" . ("\0" x 6),
    "3456789012",
  ],
  [ 10, 4, $fill2 . "\e[Ftest",			# 14: DECSTBM CPL
    "0123456789",
    "test" . ("\0" x 6),
    "1234567890",
    "3456789012",
  ],
  [ 10, 4, $fill2 . "\e[3H\e[2Etest",		# 15: DECSTBM CNL 2
    "0123456789",
    "\0" x 10,
    "test" . ("\0" x 6),
    "3456789012",
  ],
  [ 10, 4, $fill2 . "\e[2Ftest",		# 16: DECSTBM CPL 2
    "0123456789",
    "test" . ("\0" x 6),
    "\0" x 10,
    "3456789012",
  ],
  [ 10, 4, $fill2 . "\e[3H\e[4Etest",		# 17: DECSTBM CNL 4
    "0123456789",
    "\0" x 10,
    "test" . ("\0" x 6),
    "3456789012",
  ],
  [ 10, 4, $fill2 . "\e[4Ftest",		# 18: DECSTBM CPL 4
    "0123456789",
    "test" . ("\0" x 6),
    "\0" x 10,
    "3456789012",
  ],
)]);

# EOF