Debian Codegraph @

tests/t22_lists.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2 import common
3 from common import setup_module, teardown_module
4
5 class Test_decimal:
6
7 # Decimal listing of a charset.
8
9 expected = '''\
10 ISO-8859-1
11
12 0 NU 16 DL 32 SP 48 0 64 At 80 P 96 '! 112 p
13 1 SH 17 D1 33 ! 49 1 65 A 81 Q 97 a 113 q
14 2 SX 18 D2 34 " 50 2 66 B 82 R 98 b 114 r
15 3 EX 19 D3 35 Nb 51 3 67 C 83 S 99 c 115 s
16 4 ET 20 D4 36 DO 52 4 68 D 84 T 100 d 116 t
17 5 EQ 21 NK 37 % 53 5 69 E 85 U 101 e 117 u
18 6 AK 22 SY 38 & 54 6 70 F 86 V 102 f 118 v
19 7 BL 23 EB 39 ' 55 7 71 G 87 W 103 g 119 w
20 8 BS 24 CN 40 ( 56 8 72 H 88 X 104 h 120 x
21 9 HT 25 EM 41 ) 57 9 73 I 89 Y 105 i 121 y
22 10 LF 26 SB 42 * 58 : 74 J 90 Z 106 j 122 z
23 11 VT 27 EC 43 + 59 ; 75 K 91 <( 107 k 123 (!
24 12 FF 28 FS 44 , 60 < 76 L 92 // 108 l 124 !!
25 13 CR 29 GS 45 - 61 = 77 M 93 )> 109 m 125 !)
26 14 SO 30 RS 46 . 62 > 78 N 94 '> 110 n 126 '?
27 15 SI 31 US 47 / 63 ? 79 O 95 _ 111 o 127 DT
28
29 128 PA 144 DC 160 NS 176 DG 192 A! 208 D- 224 a! 240 d-
30 129 HO 145 P1 161 !I 177 +- 193 A' 209 N? 225 a' 241 n?
31 130 BH 146 P2 162 Ct 178 2S 194 A> 210 O! 226 a> 242 o!
32 131 NH 147 TS 163 Pd 179 3S 195 A? 211 O' 227 a? 243 o'
33 132 IN 148 CC 164 Cu 180 '' 196 A: 212 O> 228 a: 244 o>
34 133 NL 149 MW 165 Ye 181 My 197 AA 213 O? 229 aa 245 o?
35 134 SA 150 SG 166 BB 182 PI 198 AE 214 O: 230 ae 246 o:
36 135 ES 151 EG 167 SE 183 .M 199 C, 215 *X 231 c, 247 -:
37 136 HS 152 SS 168 ': 184 ', 200 E! 216 O/ 232 e! 248 o/
38 137 HJ 153 GC 169 Co 185 1S 201 E' 217 U! 233 e' 249 u!
39 138 VS 154 SC 170 -a 186 -o 202 E> 218 U' 234 e> 250 u'
40 139 PD 155 CI 171 << 187 >> 203 E: 219 U> 235 e: 251 u>
41 140 PU 156 ST 172 NO 188 14 204 I! 220 U: 236 i! 252 u:
42 141 RI 157 OC 173 -- 189 12 205 I' 221 Y' 237 i' 253 y'
43 142 S2 158 PM 174 Rg 190 34 206 I> 222 TH 238 i> 254 th
44 143 S3 159 AC 175 'm 191 ?I 207 I: 223 ss 239 i: 255 y:
45 '''
46
47
48 def test_1(self):
49 print('*1')
50 output = common.external_output('$R -ld latin-1')
51 common.assert_or_diff(output, self.expected)
52
53 class Test_hexadecimal:
54
55 # Hexadecimal listing of a charset.
56
57 expected = '''\
58 ISO-8859-1
59
60 00 NU 10 DL 20 SP 30 0 40 At 50 P 60 '! 70 p
61 01 SH 11 D1 21 ! 31 1 41 A 51 Q 61 a 71 q
62 02 SX 12 D2 22 " 32 2 42 B 52 R 62 b 72 r
63 03 EX 13 D3 23 Nb 33 3 43 C 53 S 63 c 73 s
64 04 ET 14 D4 24 DO 34 4 44 D 54 T 64 d 74 t
65 05 EQ 15 NK 25 % 35 5 45 E 55 U 65 e 75 u
66 06 AK 16 SY 26 & 36 6 46 F 56 V 66 f 76 v
67 07 BL 17 EB 27 ' 37 7 47 G 57 W 67 g 77 w
68 08 BS 18 CN 28 ( 38 8 48 H 58 X 68 h 78 x
69 09 HT 19 EM 29 ) 39 9 49 I 59 Y 69 i 79 y
70 0a LF 1a SB 2a * 3a : 4a J 5a Z 6a j 7a z
71 0b VT 1b EC 2b + 3b ; 4b K 5b <( 6b k 7b (!
72 0c FF 1c FS 2c , 3c < 4c L 5c // 6c l 7c !!
73 0d CR 1d GS 2d - 3d = 4d M 5d )> 6d m 7d !)
74 0e SO 1e RS 2e . 3e > 4e N 5e '> 6e n 7e '?
75 0f SI 1f US 2f / 3f ? 4f O 5f _ 6f o 7f DT
76
77 80 PA 90 DC a0 NS b0 DG c0 A! d0 D- e0 a! f0 d-
78 81 HO 91 P1 a1 !I b1 +- c1 A' d1 N? e1 a' f1 n?
79 82 BH 92 P2 a2 Ct b2 2S c2 A> d2 O! e2 a> f2 o!
80 83 NH 93 TS a3 Pd b3 3S c3 A? d3 O' e3 a? f3 o'
81 84 IN 94 CC a4 Cu b4 '' c4 A: d4 O> e4 a: f4 o>
82 85 NL 95 MW a5 Ye b5 My c5 AA d5 O? e5 aa f5 o?
83 86 SA 96 SG a6 BB b6 PI c6 AE d6 O: e6 ae f6 o:
84 87 ES 97 EG a7 SE b7 .M c7 C, d7 *X e7 c, f7 -:
85 88 HS 98 SS a8 ': b8 ', c8 E! d8 O/ e8 e! f8 o/
86 89 HJ 99 GC a9 Co b9 1S c9 E' d9 U! e9 e' f9 u!
87 8a VS 9a SC aa -a ba -o ca E> da U' ea e> fa u'
88 8b PD 9b CI ab << bb >> cb E: db U> eb e: fb u>
89 8c PU 9c ST ac NO bc 14 cc I! dc U: ec i! fc u:
90 8d RI 9d OC ad -- bd 12 cd I' dd Y' ed i' fd y'
91 8e S2 9e PM ae Rg be 34 ce I> de TH ee i> fe th
92 8f S3 9f AC af 'm bf ?I cf I: df ss ef i: ff y:
93 '''
94
95 def test_1(self):
96 output = common.external_output('$R -lh latin-1')
97 common.assert_or_diff(output, self.expected)
98
99 class Test_octal:
100
101 # Octal listing of a charset.
102
103 expected = '''\
104 ISO-8859-1
105
106 000 NU 020 DL 040 SP 060 0 100 At 120 P 140 '! 160 p
107 001 SH 021 D1 041 ! 061 1 101 A 121 Q 141 a 161 q
108 002 SX 022 D2 042 " 062 2 102 B 122 R 142 b 162 r
109 003 EX 023 D3 043 Nb 063 3 103 C 123 S 143 c 163 s
110 004 ET 024 D4 044 DO 064 4 104 D 124 T 144 d 164 t
111 005 EQ 025 NK 045 % 065 5 105 E 125 U 145 e 165 u
112 006 AK 026 SY 046 & 066 6 106 F 126 V 146 f 166 v
113 007 BL 027 EB 047 ' 067 7 107 G 127 W 147 g 167 w
114 010 BS 030 CN 050 ( 070 8 110 H 130 X 150 h 170 x
115 011 HT 031 EM 051 ) 071 9 111 I 131 Y 151 i 171 y
116 012 LF 032 SB 052 * 072 : 112 J 132 Z 152 j 172 z
117 013 VT 033 EC 053 + 073 ; 113 K 133 <( 153 k 173 (!
118 014 FF 034 FS 054 , 074 < 114 L 134 // 154 l 174 !!
119 015 CR 035 GS 055 - 075 = 115 M 135 )> 155 m 175 !)
120 016 SO 036 RS 056 . 076 > 116 N 136 '> 156 n 176 '?
121 017 SI 037 US 057 / 077 ? 117 O 137 _ 157 o 177 DT
122
123 200 PA 220 DC 240 NS 260 DG 300 A! 320 D- 340 a! 360 d-
124 201 HO 221 P1 241 !I 261 +- 301 A' 321 N? 341 a' 361 n?
125 202 BH 222 P2 242 Ct 262 2S 302 A> 322 O! 342 a> 362 o!
126 203 NH 223 TS 243 Pd 263 3S 303 A? 323 O' 343 a? 363 o'
127 204 IN 224 CC 244 Cu 264 '' 304 A: 324 O> 344 a: 364 o>
128 205 NL 225 MW 245 Ye 265 My 305 AA 325 O? 345 aa 365 o?
129 206 SA 226 SG 246 BB 266 PI 306 AE 326 O: 346 ae 366 o:
130 207 ES 227 EG 247 SE 267 .M 307 C, 327 *X 347 c, 367 -:
131 210 HS 230 SS 250 ': 270 ', 310 E! 330 O/ 350 e! 370 o/
132 211 HJ 231 GC 251 Co 271 1S 311 E' 331 U! 351 e' 371 u!
133 212 VS 232 SC 252 -a 272 -o 312 E> 332 U' 352 e> 372 u'
134 213 PD 233 CI 253 << 273 >> 313 E: 333 U> 353 e: 373 u>
135 214 PU 234 ST 254 NO 274 14 314 I! 334 U: 354 i! 374 u:
136 215 RI 235 OC 255 -- 275 12 315 I' 335 Y' 355 i' 375 y'
137 216 S2 236 PM 256 Rg 276 34 316 I> 336 TH 356 i> 376 th
138 217 S3 237 AC 257 'm 277 ?I 317 I: 337 ss 357 i: 377 y:
139 '''
140
141 def test_1(self):
142 output = common.external_output('$R -lo latin-1')
143 common.assert_or_diff(output, self.expected)
144
145 class Test_full:
146
147 # Full listing of a charset.
148
149 expected = '''\
150 Dec Oct Hex UCS2 Mne ISO-8859-1
151
152 0 000 00 0000 NU null (nul)
153 1 001 01 0001 SH start of heading (soh)
154 2 002 02 0002 SX start of text (stx)
155 3 003 03 0003 EX end of text (etx)
156 4 004 04 0004 ET end of transmission (eot)
157 5 005 05 0005 EQ enquiry (enq)
158 6 006 06 0006 AK acknowledge (ack)
159 7 007 07 0007 BL bell (bel)
160 8 010 08 0008 BS backspace (bs)
161 9 011 09 0009 HT character tabulation (ht)
162 10 012 0a 000A LF line feed (lf)
163 11 013 0b 000B VT line tabulation (vt)
164 12 014 0c 000C FF form feed (ff)
165 13 015 0d 000D CR carriage return (cr)
166 14 016 0e 000E SO shift out (so)
167 15 017 0f 000F SI shift in (si)
168 16 020 10 0010 DL datalink escape (dle)
169 17 021 11 0011 D1 device control one (dc1)
170 18 022 12 0012 D2 device control two (dc2)
171 19 023 13 0013 D3 device control three (dc3)
172 20 024 14 0014 D4 device control four (dc4)
173 21 025 15 0015 NK negative acknowledge (nak)
174 22 026 16 0016 SY syncronous idle (syn)
175 23 027 17 0017 EB end of transmission block (etb)
176 24 030 18 0018 CN cancel (can)
177 25 031 19 0019 EM end of medium (em)
178 26 032 1a 001A SB substitute (sub)
179 27 033 1b 001B EC escape (esc)
180 28 034 1c 001C FS file separator (is4)
181 29 035 1d 001D GS group separator (is3)
182 30 036 1e 001E RS record separator (is2)
183 31 037 1f 001F US unit separator (is1)
184 32 040 20 0020 SP space
185 33 041 21 0021 ! exclamation mark
186 34 042 22 0022 " quotation mark
187 35 043 23 0023 Nb number sign
188 36 044 24 0024 DO dollar sign
189 37 045 25 0025 % percent sign
190 38 046 26 0026 & ampersand
191 39 047 27 0027 ' apostrophe
192 40 050 28 0028 ( left parenthesis
193 41 051 29 0029 ) right parenthesis
194 42 052 2a 002A * asterisk
195 43 053 2b 002B + plus sign
196 44 054 2c 002C , comma
197 45 055 2d 002D - hyphen-minus
198 46 056 2e 002E . full stop
199 47 057 2f 002F / solidus
200 48 060 30 0030 0 digit zero
201 49 061 31 0031 1 digit one
202 50 062 32 0032 2 digit two
203 51 063 33 0033 3 digit three
204 52 064 34 0034 4 digit four
205 53 065 35 0035 5 digit five
206 54 066 36 0036 6 digit six
207 55 067 37 0037 7 digit seven
208 56 070 38 0038 8 digit eight
209 57 071 39 0039 9 digit nine
210 58 072 3a 003A : colon
211 59 073 3b 003B ; semicolon
212 60 074 3c 003C < less-than sign
213 61 075 3d 003D = equals sign
214 62 076 3e 003E > greater-than sign
215 63 077 3f 003F ? question mark
216 64 100 40 0040 At commercial at
217 65 101 41 0041 A latin capital letter a
218 66 102 42 0042 B latin capital letter b
219 67 103 43 0043 C latin capital letter c
220 68 104 44 0044 D latin capital letter d
221 69 105 45 0045 E latin capital letter e
222 70 106 46 0046 F latin capital letter f
223 71 107 47 0047 G latin capital letter g
224 72 110 48 0048 H latin capital letter h
225 73 111 49 0049 I latin capital letter i
226 74 112 4a 004A J latin capital letter j
227 75 113 4b 004B K latin capital letter k
228 76 114 4c 004C L latin capital letter l
229 77 115 4d 004D M latin capital letter m
230 78 116 4e 004E N latin capital letter n
231 79 117 4f 004F O latin capital letter o
232 80 120 50 0050 P latin capital letter p
233 81 121 51 0051 Q latin capital letter q
234 82 122 52 0052 R latin capital letter r
235 83 123 53 0053 S latin capital letter s
236 84 124 54 0054 T latin capital letter t
237 85 125 55 0055 U latin capital letter u
238 86 126 56 0056 V latin capital letter v
239 87 127 57 0057 W latin capital letter w
240 88 130 58 0058 X latin capital letter x
241 89 131 59 0059 Y latin capital letter y
242 90 132 5a 005A Z latin capital letter z
243 91 133 5b 005B <( left square bracket
244 92 134 5c 005C // reverse solidus
245 93 135 5d 005D )> right square bracket
246 94 136 5e 005E '> circumflex accent
247 95 137 5f 005F _ low line
248 96 140 60 0060 '! grave accent
249 97 141 61 0061 a latin small letter a
250 98 142 62 0062 b latin small letter b
251 99 143 63 0063 c latin small letter c
252 100 144 64 0064 d latin small letter d
253 101 145 65 0065 e latin small letter e
254 102 146 66 0066 f latin small letter f
255 103 147 67 0067 g latin small letter g
256 104 150 68 0068 h latin small letter h
257 105 151 69 0069 i latin small letter i
258 106 152 6a 006A j latin small letter j
259 107 153 6b 006B k latin small letter k
260 108 154 6c 006C l latin small letter l
261 109 155 6d 006D m latin small letter m
262 110 156 6e 006E n latin small letter n
263 111 157 6f 006F o latin small letter o
264 112 160 70 0070 p latin small letter p
265 113 161 71 0071 q latin small letter q
266 114 162 72 0072 r latin small letter r
267 115 163 73 0073 s latin small letter s
268 116 164 74 0074 t latin small letter t
269 117 165 75 0075 u latin small letter u
270 118 166 76 0076 v latin small letter v
271 119 167 77 0077 w latin small letter w
272 120 170 78 0078 x latin small letter x
273 121 171 79 0079 y latin small letter y
274 122 172 7a 007A z latin small letter z
275 123 173 7b 007B (! left curly bracket
276 124 174 7c 007C !! vertical line
277 125 175 7d 007D !) right curly bracket
278 126 176 7e 007E '? tilde
279 127 177 7f 007F DT delete (del)
280 128 200 80 0080 PA padding character (pad)
281 129 201 81 0081 HO high octet preset (hop)
282 130 202 82 0082 BH break permitted here (bph)
283 131 203 83 0083 NH no break here (nbh)
284 132 204 84 0084 IN index (ind)
285 133 205 85 0085 NL next line (nel)
286 134 206 86 0086 SA start of selected area (ssa)
287 135 207 87 0087 ES end of selected area (esa)
288 136 210 88 0088 HS character tabulation set (hts)
289 137 211 89 0089 HJ character tabulation with justification (htj)
290 138 212 8a 008A VS line tabulation set (vts)
291 139 213 8b 008B PD partial line forward (pld)
292 140 214 8c 008C PU partial line backward (plu)
293 141 215 8d 008D RI reverse line feed (ri)
294 142 216 8e 008E S2 single-shift two (ss2)
295 143 217 8f 008F S3 single-shift three (ss3)
296 144 220 90 0090 DC device control string (dcs)
297 145 221 91 0091 P1 private use one (pu1)
298 146 222 92 0092 P2 private use two (pu2)
299 147 223 93 0093 TS set transmit state (sts)
300 148 224 94 0094 CC cancel character (cch)
301 149 225 95 0095 MW message waiting (mw)
302 150 226 96 0096 SG start of guarded area (spa)
303 151 227 97 0097 EG end of guarded area (epa)
304 152 230 98 0098 SS start of string (sos)
305 153 231 99 0099 GC single graphic character introducer (sgci)
306 154 232 9a 009A SC single character introducer (sci)
307 155 233 9b 009B CI control sequence introducer (csi)
308 156 234 9c 009C ST string terminator (st)
309 157 235 9d 009D OC operating system command (osc)
310 158 236 9e 009E PM privacy message (pm)
311 159 237 9f 009F AC application program command (apc)
312 160 240 a0 00A0 NS no-break space
313 161 241 a1 00A1 !I inverted exclamation mark
314 162 242 a2 00A2 Ct cent sign
315 163 243 a3 00A3 Pd pound sign
316 164 244 a4 00A4 Cu currency sign
317 165 245 a5 00A5 Ye yen sign
318 166 246 a6 00A6 BB broken bar
319 167 247 a7 00A7 SE section sign
320 168 250 a8 00A8 ': diaeresis
321 169 251 a9 00A9 Co copyright sign
322 170 252 aa 00AA -a feminine ordinal indicator
323 171 253 ab 00AB << left-pointing double angle quotation mark
324 172 254 ac 00AC NO not sign
325 173 255 ad 00AD -- soft hyphen
326 174 256 ae 00AE Rg registered sign
327 175 257 af 00AF 'm macron
328 176 260 b0 00B0 DG degree sign
329 177 261 b1 00B1 +- plus-minus sign
330 178 262 b2 00B2 2S superscript two
331 179 263 b3 00B3 3S superscript three
332 180 264 b4 00B4 '' acute accent
333 181 265 b5 00B5 My micro sign
334 182 266 b6 00B6 PI pilcrow sign
335 183 267 b7 00B7 .M middle dot
336 184 270 b8 00B8 ', cedilla
337 185 271 b9 00B9 1S superscript one
338 186 272 ba 00BA -o masculine ordinal indicator
339 187 273 bb 00BB >> right-pointing double angle quotation mark
340 188 274 bc 00BC 14 vulgar fraction one quarter
341 189 275 bd 00BD 12 vulgar fraction one half
342 190 276 be 00BE 34 vulgar fraction three quarters
343 191 277 bf 00BF ?I inverted question mark
344 192 300 c0 00C0 A! latin capital letter a with grave
345 193 301 c1 00C1 A' latin capital letter a with acute
346 194 302 c2 00C2 A> latin capital letter a with circumflex
347 195 303 c3 00C3 A? latin capital letter a with tilde
348 196 304 c4 00C4 A: latin capital letter a with diaeresis
349 197 305 c5 00C5 AA latin capital letter a with ring above
350 198 306 c6 00C6 AE latin capital letter ae
351 199 307 c7 00C7 C, latin capital letter c with cedilla
352 200 310 c8 00C8 E! latin capital letter e with grave
353 201 311 c9 00C9 E' latin capital letter e with acute
354 202 312 ca 00CA E> latin capital letter e with circumflex
355 203 313 cb 00CB E: latin capital letter e with diaeresis
356 204 314 cc 00CC I! latin capital letter i with grave
357 205 315 cd 00CD I' latin capital letter i with acute
358 206 316 ce 00CE I> latin capital letter i with circumflex
359 207 317 cf 00CF I: latin capital letter i with diaeresis
360 208 320 d0 00D0 D- latin capital letter eth (icelandic)
361 209 321 d1 00D1 N? latin capital letter n with tilde
362 210 322 d2 00D2 O! latin capital letter o with grave
363 211 323 d3 00D3 O' latin capital letter o with acute
364 212 324 d4 00D4 O> latin capital letter o with circumflex
365 213 325 d5 00D5 O? latin capital letter o with tilde
366 214 326 d6 00D6 O: latin capital letter o with diaeresis
367 215 327 d7 00D7 *X multiplication sign
368 216 330 d8 00D8 O/ latin capital letter o with stroke
369 217 331 d9 00D9 U! latin capital letter u with grave
370 218 332 da 00DA U' latin capital letter u with acute
371 219 333 db 00DB U> latin capital letter u with circumflex
372 220 334 dc 00DC U: latin capital letter u with diaeresis
373 221 335 dd 00DD Y' latin capital letter y with acute
374 222 336 de 00DE TH latin capital letter thorn (icelandic)
375 223 337 df 00DF ss latin small letter sharp s (german)
376 224 340 e0 00E0 a! latin small letter a with grave
377 225 341 e1 00E1 a' latin small letter a with acute
378 226 342 e2 00E2 a> latin small letter a with circumflex
379 227 343 e3 00E3 a? latin small letter a with tilde
380 228 344 e4 00E4 a: latin small letter a with diaeresis
381 229 345 e5 00E5 aa latin small letter a with ring above
382 230 346 e6 00E6 ae latin small letter ae
383 231 347 e7 00E7 c, latin small letter c with cedilla
384 232 350 e8 00E8 e! latin small letter e with grave
385 233 351 e9 00E9 e' latin small letter e with acute
386 234 352 ea 00EA e> latin small letter e with circumflex
387 235 353 eb 00EB e: latin small letter e with diaeresis
388 236 354 ec 00EC i! latin small letter i with grave
389 237 355 ed 00ED i' latin small letter i with acute
390 238 356 ee 00EE i> latin small letter i with circumflex
391 239 357 ef 00EF i: latin small letter i with diaeresis
392 240 360 f0 00F0 d- latin small letter eth (icelandic)
393 241 361 f1 00F1 n? latin small letter n with tilde
394 242 362 f2 00F2 o! latin small letter o with grave
395 243 363 f3 00F3 o' latin small letter o with acute
396 244 364 f4 00F4 o> latin small letter o with circumflex
397 245 365 f5 00F5 o? latin small letter o with tilde
398 246 366 f6 00F6 o: latin small letter o with diaeresis
399 247 367 f7 00F7 -: division sign
400 248 370 f8 00F8 o/ latin small letter o with stroke
401 249 371 f9 00F9 u! latin small letter u with grave
402 250 372 fa 00FA u' latin small letter u with acute
403 251 373 fb 00FB u> latin small letter u with circumflex
404 252 374 fc 00FC u: latin small letter u with diaeresis
405 253 375 fd 00FD y' latin small letter y with acute
406 254 376 fe 00FE th latin small letter thorn (icelandic)
407 255 377 ff 00FF y: latin small letter y with diaeresis
408 '''
409
410 def test_1(self):
411 output = common.external_output('$R -lf latin-1')
412 common.assert_or_diff(output, self.expected)