characteristics 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/CHANGELOG.md +6 -0
- data/README.md +10 -6
- data/lib/characteristics.rb +10 -1
- data/lib/characteristics/ascii.rb +8 -0
- data/lib/characteristics/binary.rb +8 -0
- data/lib/characteristics/byte.rb +4 -0
- data/lib/characteristics/unicode.rb +4 -0
- data/lib/characteristics/version.rb +1 -1
- data/spec/characteristics_spec.rb +1828 -82
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95c672e25105f6a9281caee75f58cc242e50bee5
|
4
|
+
data.tar.gz: 17fe74e2842c0175b284e9a0b170561aba80c7af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f12e4d9b7b471019a606060166629a99e950b1e5fc3d44f933da70239f2cbc5ed4ac8023b9bb79998709a6bed14c3681dd141f1894c11ddec14649e31c68d841
|
7
|
+
data.tar.gz: 5110369bc3619f9e3ddc23c9bc6dd5abd7ff0e8ffdfd46889fbc2b04aea1d7611de607852ed0dfab04befa330e8c3e8c3afe5fa680ff0cb16ace232a5a968f6d
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ A Ruby library which provides some basic information about how characters behave
|
|
7
7
|
- Is a character a special control character?
|
8
8
|
- Could a character be invisible (blank)?
|
9
9
|
|
10
|
-
The [unibits](https://github.com/janlelis/unibits)
|
10
|
+
The [unibits](https://github.com/janlelis/unibits) and [uniscribe](https://github.com/janlelis/uniscribe) gems makes use of this data to visualize it accordingliy.
|
11
11
|
|
12
12
|
## Setup
|
13
13
|
|
@@ -20,12 +20,13 @@ gem 'characteristics'
|
|
20
20
|
## Usage
|
21
21
|
|
22
22
|
```ruby
|
23
|
-
char_info = Characteristics.
|
23
|
+
char_info = Characteristics.create(character)
|
24
24
|
char_info.valid? # => true / false
|
25
25
|
char_info.unicode? # => true / false
|
26
26
|
char_info.assigned? # => true / false
|
27
27
|
char_info.control? # => true / false
|
28
28
|
char_info.blank? # => true / false
|
29
|
+
char_info.separator? # => true / false
|
29
30
|
char_info.format? # => true / false
|
30
31
|
```
|
31
32
|
|
@@ -38,7 +39,7 @@ This library knows of four different kinds of encodings:
|
|
38
39
|
- **:byte** Known single-byte encoding
|
39
40
|
- *ISO-8859-X*, *Windows-125X*, *IBMX*, *CP85X*, *macX*, *TIS-620*, *Windows-874*, *KOI-X*
|
40
41
|
- **:ascii** 7-Bit ASCII
|
41
|
-
- *US-ASCII*
|
42
|
+
- *US-ASCII*, *GB1988*
|
42
43
|
- **:binary** Arbitrary string
|
43
44
|
- *ASCII-8BIT*
|
44
45
|
|
@@ -48,7 +49,7 @@ Other encodings are not supported, yet.
|
|
48
49
|
|
49
50
|
### `valid?`
|
50
51
|
|
51
|
-
Validness is determined by Ruby's String#valid_encoding
|
52
|
+
Validness is determined by Ruby's `String#valid_encoding?`
|
52
53
|
|
53
54
|
### `unicode?`
|
54
55
|
|
@@ -66,7 +67,11 @@ Control characters are codepoints in the is [C0, delete or C1 control character
|
|
66
67
|
|
67
68
|
### `blank?`
|
68
69
|
|
69
|
-
The library includes a list of characters that might not be rendered visually. This list does not include unassigned codepoints, control characters (except for `\t`, `\n`, `\v`, `\f`, `\r`), or special formatting characters (right-to-left
|
70
|
+
The library includes a list of characters that might not be rendered visually. This list does not include unassigned codepoints, control characters (except for `\t`, `\n`, `\v`, `\f`, `\r`, and `\u{85}` in Unicode), or special formatting characters (right-to-left markers, variation selectors, etc).
|
71
|
+
|
72
|
+
### `separator?`
|
73
|
+
|
74
|
+
Returns true if character is considered a separator. All separators also return true for the `blank?` check. In Unicode, the following characters are separators: `\n`, `\v`, `\f`, `\r`, `\u{85}` (next line), `\u{2028}` (line separator), and `\u{2029}` (paragraph separator)
|
70
75
|
|
71
76
|
### `format?`
|
72
77
|
|
@@ -75,7 +80,6 @@ This flag is `true` only for special formatting characters, which are not contro
|
|
75
80
|
## Todo
|
76
81
|
|
77
82
|
- Support all non-dummy encodings that Ruby supports
|
78
|
-
- Complete test matrix
|
79
83
|
|
80
84
|
## MIT License
|
81
85
|
|
data/lib/characteristics.rb
CHANGED
@@ -10,7 +10,7 @@ require_relative "characteristics/unicode"
|
|
10
10
|
class Characteristics
|
11
11
|
def self.type_from_encoding_name(encoding_name)
|
12
12
|
case encoding_name
|
13
|
-
when "US-ASCII"
|
13
|
+
when "US-ASCII", "GB1988"
|
14
14
|
:ascii
|
15
15
|
when "ASCII-8BIT"
|
16
16
|
:binary
|
@@ -63,6 +63,15 @@ class Characteristics
|
|
63
63
|
def control?
|
64
64
|
end
|
65
65
|
|
66
|
+
def c0?
|
67
|
+
end
|
68
|
+
|
69
|
+
def delete?
|
70
|
+
end
|
71
|
+
|
72
|
+
def c1?
|
73
|
+
end
|
74
|
+
|
66
75
|
def blank?
|
67
76
|
end
|
68
77
|
|
@@ -18,6 +18,10 @@ class AsciiCharacteristics < Characteristics
|
|
18
18
|
@ord = char.ord if @is_valid
|
19
19
|
end
|
20
20
|
|
21
|
+
def valid?
|
22
|
+
@is_valid && !(@encoding_name != "US-ASCII" && @ord >= 0x80)
|
23
|
+
end
|
24
|
+
|
21
25
|
def unicode?
|
22
26
|
false
|
23
27
|
end
|
@@ -46,6 +50,10 @@ class AsciiCharacteristics < Characteristics
|
|
46
50
|
@is_valid && ( BLANKS.include?(@ord) || SEPARATORS.include?(@ord) )
|
47
51
|
end
|
48
52
|
|
53
|
+
def separator?
|
54
|
+
SEPARATORS.include?(@ord)
|
55
|
+
end
|
56
|
+
|
49
57
|
def format?
|
50
58
|
false
|
51
59
|
end
|
@@ -43,10 +43,18 @@ class BinaryCharacteristics < Characteristics
|
|
43
43
|
@ord == 0x7F
|
44
44
|
end
|
45
45
|
|
46
|
+
def c1?
|
47
|
+
false
|
48
|
+
end
|
49
|
+
|
46
50
|
def blank?
|
47
51
|
BLANKS.include?(@ord) || SEPARATORS.include?(@ord)
|
48
52
|
end
|
49
53
|
|
54
|
+
def separator?
|
55
|
+
SEPARATORS.include?(@ord)
|
56
|
+
end
|
57
|
+
|
50
58
|
def format?
|
51
59
|
false
|
52
60
|
end
|
data/lib/characteristics/byte.rb
CHANGED
@@ -130,6 +130,10 @@ class UnicodeCharacteristics < Characteristics
|
|
130
130
|
@is_valid && ( BLANKS.include?(@ord) || SEPARATORS.include?(@ord) )
|
131
131
|
end
|
132
132
|
|
133
|
+
def separator?
|
134
|
+
@is_valid && SEPARATORS.include?(@ord)
|
135
|
+
end
|
136
|
+
|
133
137
|
def format?
|
134
138
|
@is_valid && @category == "Cf"
|
135
139
|
end
|
@@ -18,6 +18,10 @@ describe Characteristics do
|
|
18
18
|
Characteristics.create(char.force_encoding(encoding)).blank?
|
19
19
|
end
|
20
20
|
|
21
|
+
def separator?(char)
|
22
|
+
Characteristics.create(char.force_encoding(encoding)).separator?
|
23
|
+
end
|
24
|
+
|
21
25
|
def format?(char)
|
22
26
|
Characteristics.create(char.force_encoding(encoding)).format?
|
23
27
|
end
|
@@ -52,6 +56,11 @@ describe Characteristics do
|
|
52
56
|
refute blank? "\x21"
|
53
57
|
end
|
54
58
|
|
59
|
+
it "is separator or not" do
|
60
|
+
assert separator? "\n"
|
61
|
+
refute separator? "\x20"
|
62
|
+
end
|
63
|
+
|
55
64
|
it "is format or not" do
|
56
65
|
assert format? "\uFFF9"
|
57
66
|
refute format? "\x21"
|
@@ -107,6 +116,11 @@ describe Characteristics do
|
|
107
116
|
refute blank? "\x21"
|
108
117
|
end
|
109
118
|
|
119
|
+
it "is separator or not" do
|
120
|
+
assert separator? "\n"
|
121
|
+
refute separator? "\x20"
|
122
|
+
end
|
123
|
+
|
110
124
|
it "is never format" do
|
111
125
|
refute format? "\x21"
|
112
126
|
end
|
@@ -141,6 +155,48 @@ describe Characteristics do
|
|
141
155
|
refute blank? "\x21"
|
142
156
|
end
|
143
157
|
|
158
|
+
it "is separator or not" do
|
159
|
+
assert separator? "\n"
|
160
|
+
refute separator? "\x20"
|
161
|
+
end
|
162
|
+
|
163
|
+
it "is never format" do
|
164
|
+
refute format? "\x21"
|
165
|
+
end
|
166
|
+
|
167
|
+
it "is never bidi_control" do
|
168
|
+
refute bidi_control? "\x21"
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
describe "GB1988" do
|
173
|
+
let(:encoding) { "GB1988" }
|
174
|
+
|
175
|
+
it "is valid or not" do
|
176
|
+
assert valid? "\x21"
|
177
|
+
refute valid? "\x80"
|
178
|
+
end
|
179
|
+
|
180
|
+
it "is always assigned" do
|
181
|
+
assert assigned? "\x21"
|
182
|
+
end
|
183
|
+
|
184
|
+
it "is control or not" do
|
185
|
+
assert control? "\x1E"
|
186
|
+
assert control? "\x7F"
|
187
|
+
refute control? "\x67"
|
188
|
+
end
|
189
|
+
|
190
|
+
it "is blank or not" do
|
191
|
+
assert blank? "\x20"
|
192
|
+
refute blank? "\x21"
|
193
|
+
end
|
194
|
+
|
195
|
+
it "is separator or not" do
|
196
|
+
assert separator? "\n"
|
197
|
+
refute separator? "\x20"
|
198
|
+
end
|
199
|
+
|
144
200
|
it "is never format" do
|
145
201
|
refute format? "\x21"
|
146
202
|
end
|
@@ -177,6 +233,11 @@ describe Characteristics do
|
|
177
233
|
refute blank? "\x21"
|
178
234
|
end
|
179
235
|
|
236
|
+
it "is separator or not" do
|
237
|
+
assert separator? "\n"
|
238
|
+
refute separator? "\x20"
|
239
|
+
end
|
240
|
+
|
180
241
|
it "is never format" do
|
181
242
|
refute format? "\x21"
|
182
243
|
end
|
@@ -186,27 +247,46 @@ describe Characteristics do
|
|
186
247
|
end
|
187
248
|
end
|
188
249
|
|
189
|
-
|
250
|
+
describe "ISO-8859-2" do
|
251
|
+
let(:encoding) { "ISO-8859-2" }
|
190
252
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
# describe "ISO-8859-5" do
|
195
|
-
# describe "ISO-8859-6" do
|
196
|
-
# describe "ISO-8859-7" do
|
197
|
-
# describe "ISO-8859-8" do
|
198
|
-
# describe "ISO-8859-9" do
|
199
|
-
# describe "ISO-8859-10" do
|
200
|
-
# describe "ISO-8859-11" do
|
201
|
-
# describe "ISO-8859-13" do
|
202
|
-
# describe "ISO-8859-14" do
|
203
|
-
# describe "ISO-8859-15" do
|
204
|
-
# describe "ISO-8859-16" do
|
205
|
-
end
|
253
|
+
it "is always valid" do
|
254
|
+
assert valid? "\x80"
|
255
|
+
end
|
206
256
|
|
207
|
-
|
208
|
-
|
209
|
-
|
257
|
+
it "is always assigned" do
|
258
|
+
assert assigned? "\x21"
|
259
|
+
assert assigned? "\x80"
|
260
|
+
end
|
261
|
+
|
262
|
+
it "is control or not" do
|
263
|
+
assert control? "\x1E"
|
264
|
+
assert control? "\x7F"
|
265
|
+
assert control? "\x80"
|
266
|
+
refute control? "\x67"
|
267
|
+
end
|
268
|
+
|
269
|
+
it "is blank or not" do
|
270
|
+
assert blank? "\x20"
|
271
|
+
refute blank? "\x21"
|
272
|
+
end
|
273
|
+
|
274
|
+
it "is separator or not" do
|
275
|
+
assert separator? "\n"
|
276
|
+
refute separator? "\x20"
|
277
|
+
end
|
278
|
+
|
279
|
+
it "is never format" do
|
280
|
+
refute format? "\x21"
|
281
|
+
end
|
282
|
+
|
283
|
+
it "is never bidi_control" do
|
284
|
+
refute bidi_control? "\x21"
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
describe "ISO-8859-3" do
|
289
|
+
let(:encoding) { "ISO-8859-3" }
|
210
290
|
|
211
291
|
it "is always valid" do
|
212
292
|
assert valid? "\x80"
|
@@ -214,11 +294,13 @@ describe Characteristics do
|
|
214
294
|
|
215
295
|
it "is assigned or not" do
|
216
296
|
assert assigned? "\x21"
|
217
|
-
refute assigned? "\
|
297
|
+
refute assigned? "\xA5"
|
218
298
|
end
|
219
299
|
|
220
300
|
it "is control or not" do
|
221
301
|
assert control? "\x1E"
|
302
|
+
assert control? "\x7F"
|
303
|
+
assert control? "\x80"
|
222
304
|
refute control? "\x67"
|
223
305
|
end
|
224
306
|
|
@@ -227,6 +309,11 @@ describe Characteristics do
|
|
227
309
|
refute blank? "\x21"
|
228
310
|
end
|
229
311
|
|
312
|
+
it "is separator or not" do
|
313
|
+
assert separator? "\n"
|
314
|
+
refute separator? "\x20"
|
315
|
+
end
|
316
|
+
|
230
317
|
it "is never format" do
|
231
318
|
refute format? "\x21"
|
232
319
|
end
|
@@ -236,33 +323,22 @@ describe Characteristics do
|
|
236
323
|
end
|
237
324
|
end
|
238
325
|
|
239
|
-
|
240
|
-
|
241
|
-
# describe "Windows-1250" do
|
242
|
-
# describe "Windows-1251" do
|
243
|
-
# describe "Windows-1253" do
|
244
|
-
# describe "Windows-1254" do
|
245
|
-
# describe "Windows-1255" do
|
246
|
-
# describe "Windows-1256" do
|
247
|
-
# describe "Windows-1257" do
|
248
|
-
# describe "Windows-1258" do
|
249
|
-
end
|
250
|
-
|
251
|
-
describe "IBM*, CP85*" do
|
252
|
-
describe "IBM869" do
|
253
|
-
let(:encoding) { "IBM869" }
|
326
|
+
describe "ISO-8859-4" do
|
327
|
+
let(:encoding) { "ISO-8859-4" }
|
254
328
|
|
255
329
|
it "is always valid" do
|
256
330
|
assert valid? "\x80"
|
257
331
|
end
|
258
332
|
|
259
|
-
it "is assigned
|
333
|
+
it "is always assigned" do
|
260
334
|
assert assigned? "\x21"
|
261
|
-
|
335
|
+
assert assigned? "\x80"
|
262
336
|
end
|
263
337
|
|
264
338
|
it "is control or not" do
|
265
339
|
assert control? "\x1E"
|
340
|
+
assert control? "\x7F"
|
341
|
+
assert control? "\x80"
|
266
342
|
refute control? "\x67"
|
267
343
|
end
|
268
344
|
|
@@ -271,6 +347,11 @@ describe Characteristics do
|
|
271
347
|
refute blank? "\x21"
|
272
348
|
end
|
273
349
|
|
350
|
+
it "is separator or not" do
|
351
|
+
assert separator? "\n"
|
352
|
+
refute separator? "\x20"
|
353
|
+
end
|
354
|
+
|
274
355
|
it "is never format" do
|
275
356
|
refute format? "\x21"
|
276
357
|
end
|
@@ -280,27 +361,8 @@ describe Characteristics do
|
|
280
361
|
end
|
281
362
|
end
|
282
363
|
|
283
|
-
|
284
|
-
|
285
|
-
# describe "IBM775" do
|
286
|
-
# describe "CP850" do
|
287
|
-
# describe "IBM852" do
|
288
|
-
# describe "CP852" do
|
289
|
-
# describe "IBM855" do
|
290
|
-
# describe "CP855" do
|
291
|
-
# describe "IBM857" do
|
292
|
-
# describe "IBM860" do
|
293
|
-
# describe "IBM861" do
|
294
|
-
# describe "IBM862" do
|
295
|
-
# describe "IBM863" do
|
296
|
-
# describe "IBM864" do
|
297
|
-
# describe "IBM865" do
|
298
|
-
# describe "IBM866" do
|
299
|
-
end
|
300
|
-
|
301
|
-
describe "mac*" do
|
302
|
-
describe "macRoman" do
|
303
|
-
let(:encoding) { "macRoman" }
|
364
|
+
describe "ISO-8859-5" do
|
365
|
+
let(:encoding) { "ISO-8859-5" }
|
304
366
|
|
305
367
|
it "is always valid" do
|
306
368
|
assert valid? "\x80"
|
@@ -308,10 +370,13 @@ describe Characteristics do
|
|
308
370
|
|
309
371
|
it "is always assigned" do
|
310
372
|
assert assigned? "\x21"
|
373
|
+
assert assigned? "\x80"
|
311
374
|
end
|
312
375
|
|
313
376
|
it "is control or not" do
|
314
377
|
assert control? "\x1E"
|
378
|
+
assert control? "\x7F"
|
379
|
+
assert control? "\x80"
|
315
380
|
refute control? "\x67"
|
316
381
|
end
|
317
382
|
|
@@ -320,6 +385,11 @@ describe Characteristics do
|
|
320
385
|
refute blank? "\x21"
|
321
386
|
end
|
322
387
|
|
388
|
+
it "is separator or not" do
|
389
|
+
assert separator? "\n"
|
390
|
+
refute separator? "\x20"
|
391
|
+
end
|
392
|
+
|
323
393
|
it "is never format" do
|
324
394
|
refute format? "\x21"
|
325
395
|
end
|
@@ -329,20 +399,46 @@ describe Characteristics do
|
|
329
399
|
end
|
330
400
|
end
|
331
401
|
|
332
|
-
|
333
|
-
|
334
|
-
# describe "macCyrillic" do
|
335
|
-
# describe "macGreek" do
|
336
|
-
# describe "macIceland" do
|
337
|
-
# describe "macRomania" do
|
338
|
-
# describe "macThai" do
|
339
|
-
# describe "macTurkish" do
|
340
|
-
# describe "macUkraine" do
|
341
|
-
end
|
402
|
+
describe "ISO-8859-6" do
|
403
|
+
let(:encoding) { "ISO-8859-6" }
|
342
404
|
|
343
|
-
|
344
|
-
|
345
|
-
|
405
|
+
it "is always valid" do
|
406
|
+
assert valid? "\x80"
|
407
|
+
end
|
408
|
+
|
409
|
+
it "is assigned or not" do
|
410
|
+
assert assigned? "\x21"
|
411
|
+
refute assigned? "\xA1"
|
412
|
+
end
|
413
|
+
|
414
|
+
it "is control or not" do
|
415
|
+
assert control? "\x1E"
|
416
|
+
assert control? "\x7F"
|
417
|
+
assert control? "\x80"
|
418
|
+
refute control? "\x67"
|
419
|
+
end
|
420
|
+
|
421
|
+
it "is blank or not" do
|
422
|
+
assert blank? "\x20"
|
423
|
+
refute blank? "\x21"
|
424
|
+
end
|
425
|
+
|
426
|
+
it "is separator or not" do
|
427
|
+
assert separator? "\n"
|
428
|
+
refute separator? "\x20"
|
429
|
+
end
|
430
|
+
|
431
|
+
it "is never format" do
|
432
|
+
refute format? "\x21"
|
433
|
+
end
|
434
|
+
|
435
|
+
it "is never bidi_control" do
|
436
|
+
refute bidi_control? "\x21"
|
437
|
+
end
|
438
|
+
end
|
439
|
+
|
440
|
+
describe "ISO-8859-7" do
|
441
|
+
let(:encoding) { "ISO-8859-7" }
|
346
442
|
|
347
443
|
it "is always valid" do
|
348
444
|
assert valid? "\x80"
|
@@ -350,11 +446,13 @@ describe Characteristics do
|
|
350
446
|
|
351
447
|
it "is assigned or not" do
|
352
448
|
assert assigned? "\x21"
|
353
|
-
refute assigned? "\
|
449
|
+
refute assigned? "\xFF"
|
354
450
|
end
|
355
451
|
|
356
452
|
it "is control or not" do
|
357
453
|
assert control? "\x1E"
|
454
|
+
assert control? "\x7F"
|
455
|
+
assert control? "\x80"
|
358
456
|
refute control? "\x67"
|
359
457
|
end
|
360
458
|
|
@@ -363,6 +461,11 @@ describe Characteristics do
|
|
363
461
|
refute blank? "\x21"
|
364
462
|
end
|
365
463
|
|
464
|
+
it "is separator or not" do
|
465
|
+
assert separator? "\n"
|
466
|
+
refute separator? "\x20"
|
467
|
+
end
|
468
|
+
|
366
469
|
it "is never format" do
|
367
470
|
refute format? "\x21"
|
368
471
|
end
|
@@ -372,20 +475,62 @@ describe Characteristics do
|
|
372
475
|
end
|
373
476
|
end
|
374
477
|
|
375
|
-
describe "
|
376
|
-
let(:encoding) { "
|
478
|
+
describe "ISO-8859-8" do
|
479
|
+
let(:encoding) { "ISO-8859-8" }
|
377
480
|
|
378
481
|
it "is always valid" do
|
379
482
|
assert valid? "\x80"
|
380
483
|
end
|
381
484
|
|
382
485
|
it "is assigned or not" do
|
383
|
-
assert assigned? "\
|
384
|
-
refute assigned? "\
|
486
|
+
assert assigned? "\x21"
|
487
|
+
refute assigned? "\xA1"
|
488
|
+
end
|
489
|
+
|
490
|
+
it "is control or not" do
|
491
|
+
assert control? "\x1E"
|
492
|
+
assert control? "\x7F"
|
493
|
+
assert control? "\x80"
|
494
|
+
refute control? "\x67"
|
495
|
+
end
|
496
|
+
|
497
|
+
it "is blank or not" do
|
498
|
+
assert blank? "\x20"
|
499
|
+
refute blank? "\x21"
|
500
|
+
end
|
501
|
+
|
502
|
+
it "is separator or not" do
|
503
|
+
assert separator? "\n"
|
504
|
+
refute separator? "\x20"
|
505
|
+
end
|
506
|
+
|
507
|
+
it "is format or not" do
|
508
|
+
assert format? "\xFE"
|
509
|
+
refute format? "\x21"
|
510
|
+
end
|
511
|
+
|
512
|
+
it "is bidi_control or not" do
|
513
|
+
assert bidi_control? "\xFE"
|
514
|
+
refute bidi_control? "\x21"
|
515
|
+
end
|
516
|
+
end
|
517
|
+
|
518
|
+
describe "ISO-8859-9" do
|
519
|
+
let(:encoding) { "ISO-8859-9" }
|
520
|
+
|
521
|
+
it "is always valid" do
|
522
|
+
assert valid? "\x80"
|
523
|
+
end
|
524
|
+
|
525
|
+
it "is always assigned" do
|
526
|
+
assert assigned? "\x21"
|
527
|
+
assert assigned? "\x80"
|
385
528
|
end
|
386
529
|
|
387
530
|
it "is control or not" do
|
388
531
|
assert control? "\x1E"
|
532
|
+
assert control? "\x7F"
|
533
|
+
assert control? "\x80"
|
389
534
|
refute control? "\x67"
|
390
535
|
end
|
391
536
|
|
@@ -394,6 +539,11 @@ describe Characteristics do
|
|
394
539
|
refute blank? "\x21"
|
395
540
|
end
|
396
541
|
|
542
|
+
it "is separator or not" do
|
543
|
+
assert separator? "\n"
|
544
|
+
refute separator? "\x20"
|
545
|
+
end
|
546
|
+
|
397
547
|
it "is never format" do
|
398
548
|
refute format? "\x21"
|
399
549
|
end
|
@@ -402,11 +552,9 @@ describe Characteristics do
|
|
402
552
|
refute bidi_control? "\x21"
|
403
553
|
end
|
404
554
|
end
|
405
|
-
end
|
406
555
|
|
407
|
-
|
408
|
-
|
409
|
-
let(:encoding) { "KOI8-R" }
|
556
|
+
describe "ISO-8859-10" do
|
557
|
+
let(:encoding) { "ISO-8859-10" }
|
410
558
|
|
411
559
|
it "is always valid" do
|
412
560
|
assert valid? "\x80"
|
@@ -414,10 +562,51 @@ describe Characteristics do
|
|
414
562
|
|
415
563
|
it "is always assigned" do
|
416
564
|
assert assigned? "\x21"
|
565
|
+
assert assigned? "\x80"
|
566
|
+
end
|
567
|
+
|
568
|
+
it "is control or not" do
|
569
|
+
assert control? "\x1E"
|
570
|
+
assert control? "\x7F"
|
571
|
+
assert control? "\x80"
|
572
|
+
refute control? "\x67"
|
573
|
+
end
|
574
|
+
|
575
|
+
it "is blank or not" do
|
576
|
+
assert blank? "\x20"
|
577
|
+
refute blank? "\x21"
|
578
|
+
end
|
579
|
+
|
580
|
+
it "is separator or not" do
|
581
|
+
assert separator? "\n"
|
582
|
+
refute separator? "\x20"
|
583
|
+
end
|
584
|
+
|
585
|
+
it "is never format" do
|
586
|
+
refute format? "\x21"
|
587
|
+
end
|
588
|
+
|
589
|
+
it "is never bidi_control" do
|
590
|
+
refute bidi_control? "\x21"
|
591
|
+
end
|
592
|
+
end
|
593
|
+
|
594
|
+
describe "ISO-8859-11" do
|
595
|
+
let(:encoding) { "ISO-8859-11" }
|
596
|
+
|
597
|
+
it "is always valid" do
|
598
|
+
assert valid? "\x80"
|
599
|
+
end
|
600
|
+
|
601
|
+
it "is assigned or not" do
|
602
|
+
assert assigned? "\x21"
|
603
|
+
refute assigned? "\xDB"
|
417
604
|
end
|
418
605
|
|
419
606
|
it "is control or not" do
|
420
607
|
assert control? "\x1E"
|
608
|
+
assert control? "\x7F"
|
609
|
+
assert control? "\x80"
|
421
610
|
refute control? "\x67"
|
422
611
|
end
|
423
612
|
|
@@ -426,6 +615,11 @@ describe Characteristics do
|
|
426
615
|
refute blank? "\x21"
|
427
616
|
end
|
428
617
|
|
618
|
+
it "is separator or not" do
|
619
|
+
assert separator? "\n"
|
620
|
+
refute separator? "\x20"
|
621
|
+
end
|
622
|
+
|
429
623
|
it "is never format" do
|
430
624
|
refute format? "\x21"
|
431
625
|
end
|
@@ -435,8 +629,8 @@ describe Characteristics do
|
|
435
629
|
end
|
436
630
|
end
|
437
631
|
|
438
|
-
describe "
|
439
|
-
let(:encoding) { "
|
632
|
+
describe "ISO-8859-13" do
|
633
|
+
let(:encoding) { "ISO-8859-13" }
|
440
634
|
|
441
635
|
it "is always valid" do
|
442
636
|
assert valid? "\x80"
|
@@ -444,10 +638,13 @@ describe Characteristics do
|
|
444
638
|
|
445
639
|
it "is always assigned" do
|
446
640
|
assert assigned? "\x21"
|
641
|
+
assert assigned? "\x80"
|
447
642
|
end
|
448
643
|
|
449
644
|
it "is control or not" do
|
450
645
|
assert control? "\x1E"
|
646
|
+
assert control? "\x7F"
|
647
|
+
assert control? "\x80"
|
451
648
|
refute control? "\x67"
|
452
649
|
end
|
453
650
|
|
@@ -456,6 +653,1555 @@ describe Characteristics do
|
|
456
653
|
refute blank? "\x21"
|
457
654
|
end
|
458
655
|
|
656
|
+
it "is separator or not" do
|
657
|
+
assert separator? "\n"
|
658
|
+
refute separator? "\x20"
|
659
|
+
end
|
660
|
+
|
661
|
+
it "is never format" do
|
662
|
+
refute format? "\x21"
|
663
|
+
end
|
664
|
+
|
665
|
+
it "is never bidi_control" do
|
666
|
+
refute bidi_control? "\x21"
|
667
|
+
end
|
668
|
+
end
|
669
|
+
|
670
|
+
describe "ISO-8859-14" do
|
671
|
+
let(:encoding) { "ISO-8859-14" }
|
672
|
+
|
673
|
+
it "is always valid" do
|
674
|
+
assert valid? "\x80"
|
675
|
+
end
|
676
|
+
|
677
|
+
it "is always assigned" do
|
678
|
+
assert assigned? "\x21"
|
679
|
+
assert assigned? "\x80"
|
680
|
+
end
|
681
|
+
|
682
|
+
it "is control or not" do
|
683
|
+
assert control? "\x1E"
|
684
|
+
assert control? "\x7F"
|
685
|
+
assert control? "\x80"
|
686
|
+
refute control? "\x67"
|
687
|
+
end
|
688
|
+
|
689
|
+
it "is blank or not" do
|
690
|
+
assert blank? "\x20"
|
691
|
+
refute blank? "\x21"
|
692
|
+
end
|
693
|
+
|
694
|
+
it "is separator or not" do
|
695
|
+
assert separator? "\n"
|
696
|
+
refute separator? "\x20"
|
697
|
+
end
|
698
|
+
|
699
|
+
it "is never format" do
|
700
|
+
refute format? "\x21"
|
701
|
+
end
|
702
|
+
|
703
|
+
it "is never bidi_control" do
|
704
|
+
refute bidi_control? "\x21"
|
705
|
+
end
|
706
|
+
end
|
707
|
+
|
708
|
+
describe "ISO-8859-15" do
|
709
|
+
let(:encoding) { "ISO-8859-15" }
|
710
|
+
|
711
|
+
it "is always valid" do
|
712
|
+
assert valid? "\x80"
|
713
|
+
end
|
714
|
+
|
715
|
+
it "is always assigned" do
|
716
|
+
assert assigned? "\x21"
|
717
|
+
assert assigned? "\x80"
|
718
|
+
end
|
719
|
+
|
720
|
+
it "is control or not" do
|
721
|
+
assert control? "\x1E"
|
722
|
+
assert control? "\x7F"
|
723
|
+
assert control? "\x80"
|
724
|
+
refute control? "\x67"
|
725
|
+
end
|
726
|
+
|
727
|
+
it "is blank or not" do
|
728
|
+
assert blank? "\x20"
|
729
|
+
refute blank? "\x21"
|
730
|
+
end
|
731
|
+
|
732
|
+
it "is separator or not" do
|
733
|
+
assert separator? "\n"
|
734
|
+
refute separator? "\x20"
|
735
|
+
end
|
736
|
+
|
737
|
+
it "is never format" do
|
738
|
+
refute format? "\x21"
|
739
|
+
end
|
740
|
+
|
741
|
+
it "is never bidi_control" do
|
742
|
+
refute bidi_control? "\x21"
|
743
|
+
end
|
744
|
+
end
|
745
|
+
|
746
|
+
describe "ISO-8859-16" do
|
747
|
+
let(:encoding) { "ISO-8859-16" }
|
748
|
+
|
749
|
+
it "is always valid" do
|
750
|
+
assert valid? "\x80"
|
751
|
+
end
|
752
|
+
|
753
|
+
it "is always assigned" do
|
754
|
+
assert assigned? "\x21"
|
755
|
+
assert assigned? "\x80"
|
756
|
+
end
|
757
|
+
|
758
|
+
it "is control or not" do
|
759
|
+
assert control? "\x1E"
|
760
|
+
assert control? "\x7F"
|
761
|
+
assert control? "\x80"
|
762
|
+
refute control? "\x67"
|
763
|
+
end
|
764
|
+
|
765
|
+
it "is blank or not" do
|
766
|
+
assert blank? "\x20"
|
767
|
+
refute blank? "\x21"
|
768
|
+
end
|
769
|
+
|
770
|
+
it "is separator or not" do
|
771
|
+
assert separator? "\n"
|
772
|
+
refute separator? "\x20"
|
773
|
+
end
|
774
|
+
|
775
|
+
it "is never format" do
|
776
|
+
refute format? "\x21"
|
777
|
+
end
|
778
|
+
|
779
|
+
it "is never bidi_control" do
|
780
|
+
refute bidi_control? "\x21"
|
781
|
+
end
|
782
|
+
end
|
783
|
+
end
|
784
|
+
|
785
|
+
describe "Windows-125*" do
|
786
|
+
describe "Windows-1250" do
|
787
|
+
let(:encoding) { "Windows-1250" }
|
788
|
+
|
789
|
+
it "is always valid" do
|
790
|
+
assert valid? "\x80"
|
791
|
+
end
|
792
|
+
|
793
|
+
it "is assigned or not" do
|
794
|
+
assert assigned? "\x21"
|
795
|
+
refute assigned? "\x81"
|
796
|
+
end
|
797
|
+
|
798
|
+
it "is control or not" do
|
799
|
+
assert control? "\x1E"
|
800
|
+
refute control? "\x67"
|
801
|
+
end
|
802
|
+
|
803
|
+
it "is blank or not" do
|
804
|
+
assert blank? "\x20"
|
805
|
+
refute blank? "\x21"
|
806
|
+
end
|
807
|
+
|
808
|
+
it "is separator or not" do
|
809
|
+
assert separator? "\n"
|
810
|
+
refute separator? "\x20"
|
811
|
+
end
|
812
|
+
|
813
|
+
it "is never format" do
|
814
|
+
refute format? "\x21"
|
815
|
+
end
|
816
|
+
|
817
|
+
it "is never bidi_control" do
|
818
|
+
refute bidi_control? "\x21"
|
819
|
+
end
|
820
|
+
end
|
821
|
+
|
822
|
+
describe "Windows-1251" do
|
823
|
+
let(:encoding) { "Windows-1251" }
|
824
|
+
|
825
|
+
it "is always valid" do
|
826
|
+
assert valid? "\x80"
|
827
|
+
end
|
828
|
+
|
829
|
+
it "is assigned or not" do
|
830
|
+
assert assigned? "\x21"
|
831
|
+
refute assigned? "\x98"
|
832
|
+
end
|
833
|
+
|
834
|
+
it "is control or not" do
|
835
|
+
assert control? "\x1E"
|
836
|
+
refute control? "\x67"
|
837
|
+
end
|
838
|
+
|
839
|
+
it "is blank or not" do
|
840
|
+
assert blank? "\x20"
|
841
|
+
refute blank? "\x21"
|
842
|
+
end
|
843
|
+
|
844
|
+
it "is separator or not" do
|
845
|
+
assert separator? "\n"
|
846
|
+
refute separator? "\x20"
|
847
|
+
end
|
848
|
+
|
849
|
+
it "is never format" do
|
850
|
+
refute format? "\x21"
|
851
|
+
end
|
852
|
+
|
853
|
+
it "is never bidi_control" do
|
854
|
+
refute bidi_control? "\x21"
|
855
|
+
end
|
856
|
+
end
|
857
|
+
|
858
|
+
describe "Windows-1252" do
|
859
|
+
let(:encoding) { "Windows-1252" }
|
860
|
+
|
861
|
+
it "is always valid" do
|
862
|
+
assert valid? "\x80"
|
863
|
+
end
|
864
|
+
|
865
|
+
it "is assigned or not" do
|
866
|
+
assert assigned? "\x21"
|
867
|
+
refute assigned? "\x81"
|
868
|
+
end
|
869
|
+
|
870
|
+
it "is control or not" do
|
871
|
+
assert control? "\x1E"
|
872
|
+
refute control? "\x67"
|
873
|
+
end
|
874
|
+
|
875
|
+
it "is blank or not" do
|
876
|
+
assert blank? "\x20"
|
877
|
+
refute blank? "\x21"
|
878
|
+
end
|
879
|
+
|
880
|
+
it "is separator or not" do
|
881
|
+
assert separator? "\n"
|
882
|
+
refute separator? "\x20"
|
883
|
+
end
|
884
|
+
|
885
|
+
it "is never format" do
|
886
|
+
refute format? "\x21"
|
887
|
+
end
|
888
|
+
|
889
|
+
it "is never bidi_control" do
|
890
|
+
refute bidi_control? "\x21"
|
891
|
+
end
|
892
|
+
end
|
893
|
+
|
894
|
+
describe "Windows-1253" do
|
895
|
+
let(:encoding) { "Windows-1253" }
|
896
|
+
|
897
|
+
it "is always valid" do
|
898
|
+
assert valid? "\x80"
|
899
|
+
end
|
900
|
+
|
901
|
+
it "is assigned or not" do
|
902
|
+
assert assigned? "\x21"
|
903
|
+
refute assigned? "\x81"
|
904
|
+
end
|
905
|
+
|
906
|
+
it "is control or not" do
|
907
|
+
assert control? "\x1E"
|
908
|
+
refute control? "\x67"
|
909
|
+
end
|
910
|
+
|
911
|
+
it "is blank or not" do
|
912
|
+
assert blank? "\x20"
|
913
|
+
refute blank? "\x21"
|
914
|
+
end
|
915
|
+
|
916
|
+
it "is separator or not" do
|
917
|
+
assert separator? "\n"
|
918
|
+
refute separator? "\x20"
|
919
|
+
end
|
920
|
+
|
921
|
+
it "is never format" do
|
922
|
+
refute format? "\x21"
|
923
|
+
end
|
924
|
+
|
925
|
+
it "is never bidi_control" do
|
926
|
+
refute bidi_control? "\x21"
|
927
|
+
end
|
928
|
+
end
|
929
|
+
|
930
|
+
describe "Windows-1254" do
|
931
|
+
let(:encoding) { "Windows-1254" }
|
932
|
+
|
933
|
+
it "is always valid" do
|
934
|
+
assert valid? "\x80"
|
935
|
+
end
|
936
|
+
|
937
|
+
it "is assigned or not" do
|
938
|
+
assert assigned? "\x21"
|
939
|
+
refute assigned? "\x81"
|
940
|
+
end
|
941
|
+
|
942
|
+
it "is control or not" do
|
943
|
+
assert control? "\x1E"
|
944
|
+
refute control? "\x67"
|
945
|
+
end
|
946
|
+
|
947
|
+
it "is blank or not" do
|
948
|
+
assert blank? "\x20"
|
949
|
+
refute blank? "\x21"
|
950
|
+
end
|
951
|
+
|
952
|
+
it "is separator or not" do
|
953
|
+
assert separator? "\n"
|
954
|
+
refute separator? "\x20"
|
955
|
+
end
|
956
|
+
|
957
|
+
it "is never format" do
|
958
|
+
refute format? "\x21"
|
959
|
+
end
|
960
|
+
|
961
|
+
it "is never bidi_control" do
|
962
|
+
refute bidi_control? "\x21"
|
963
|
+
end
|
964
|
+
end
|
965
|
+
|
966
|
+
describe "Windows-1255" do
|
967
|
+
let(:encoding) { "Windows-1255" }
|
968
|
+
|
969
|
+
it "is always valid" do
|
970
|
+
assert valid? "\x80"
|
971
|
+
end
|
972
|
+
|
973
|
+
it "is assigned or not" do
|
974
|
+
assert assigned? "\x21"
|
975
|
+
refute assigned? "\x81"
|
976
|
+
end
|
977
|
+
|
978
|
+
it "is control or not" do
|
979
|
+
assert control? "\x1E"
|
980
|
+
refute control? "\x67"
|
981
|
+
end
|
982
|
+
|
983
|
+
it "is blank or not" do
|
984
|
+
assert blank? "\x20"
|
985
|
+
refute blank? "\x21"
|
986
|
+
end
|
987
|
+
|
988
|
+
it "is separator or not" do
|
989
|
+
assert separator? "\n"
|
990
|
+
refute separator? "\x20"
|
991
|
+
end
|
992
|
+
|
993
|
+
it "is format or not" do
|
994
|
+
assert format? "\xFE"
|
995
|
+
refute format? "\x21"
|
996
|
+
end
|
997
|
+
|
998
|
+
it "is never bidi_control" do
|
999
|
+
assert bidi_control? "\xFE"
|
1000
|
+
refute bidi_control? "\x21"
|
1001
|
+
end
|
1002
|
+
end
|
1003
|
+
|
1004
|
+
describe "Windows-1256" do
|
1005
|
+
let(:encoding) { "Windows-1256" }
|
1006
|
+
|
1007
|
+
it "is always valid" do
|
1008
|
+
assert valid? "\x80"
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
it "is always assigned" do
|
1012
|
+
assert assigned? "\x21"
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
it "is control or not" do
|
1016
|
+
assert control? "\x1E"
|
1017
|
+
refute control? "\x67"
|
1018
|
+
end
|
1019
|
+
|
1020
|
+
it "is blank or not" do
|
1021
|
+
assert blank? "\x20"
|
1022
|
+
refute blank? "\x21"
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
it "is separator or not" do
|
1026
|
+
assert separator? "\n"
|
1027
|
+
refute separator? "\x20"
|
1028
|
+
end
|
1029
|
+
|
1030
|
+
it "is format or not" do
|
1031
|
+
assert format? "\xFE"
|
1032
|
+
refute format? "\x21"
|
1033
|
+
end
|
1034
|
+
|
1035
|
+
it "is never bidi_control" do
|
1036
|
+
assert bidi_control? "\xFE"
|
1037
|
+
refute bidi_control? "\x21"
|
1038
|
+
end
|
1039
|
+
end
|
1040
|
+
|
1041
|
+
describe "Windows-1257" do
|
1042
|
+
let(:encoding) { "Windows-1257" }
|
1043
|
+
|
1044
|
+
it "is always valid" do
|
1045
|
+
assert valid? "\x80"
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
it "is assigned or not" do
|
1049
|
+
assert assigned? "\x21"
|
1050
|
+
refute assigned? "\x81"
|
1051
|
+
end
|
1052
|
+
|
1053
|
+
it "is control or not" do
|
1054
|
+
assert control? "\x1E"
|
1055
|
+
refute control? "\x67"
|
1056
|
+
end
|
1057
|
+
|
1058
|
+
it "is blank or not" do
|
1059
|
+
assert blank? "\x20"
|
1060
|
+
refute blank? "\x21"
|
1061
|
+
end
|
1062
|
+
|
1063
|
+
it "is separator or not" do
|
1064
|
+
assert separator? "\n"
|
1065
|
+
refute separator? "\x20"
|
1066
|
+
end
|
1067
|
+
|
1068
|
+
it "is never format" do
|
1069
|
+
refute format? "\x21"
|
1070
|
+
end
|
1071
|
+
|
1072
|
+
it "is never bidi_control" do
|
1073
|
+
refute bidi_control? "\x21"
|
1074
|
+
end
|
1075
|
+
end
|
1076
|
+
|
1077
|
+
describe "Windows-1258" do
|
1078
|
+
let(:encoding) { "Windows-1258" }
|
1079
|
+
|
1080
|
+
it "is always valid" do
|
1081
|
+
assert valid? "\x80"
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
it "is assigned or not" do
|
1085
|
+
assert assigned? "\x21"
|
1086
|
+
refute assigned? "\x81"
|
1087
|
+
end
|
1088
|
+
|
1089
|
+
it "is control or not" do
|
1090
|
+
assert control? "\x1E"
|
1091
|
+
refute control? "\x67"
|
1092
|
+
end
|
1093
|
+
|
1094
|
+
it "is blank or not" do
|
1095
|
+
assert blank? "\x20"
|
1096
|
+
refute blank? "\x21"
|
1097
|
+
end
|
1098
|
+
|
1099
|
+
it "is separator or not" do
|
1100
|
+
assert separator? "\n"
|
1101
|
+
refute separator? "\x20"
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
it "is never format" do
|
1105
|
+
refute format? "\x21"
|
1106
|
+
end
|
1107
|
+
|
1108
|
+
it "is never bidi_control" do
|
1109
|
+
refute bidi_control? "\x21"
|
1110
|
+
end
|
1111
|
+
end
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
describe "IBM*, CP85*" do
|
1115
|
+
describe "IBM437" do
|
1116
|
+
let(:encoding) { "IBM437" }
|
1117
|
+
|
1118
|
+
it "is always valid" do
|
1119
|
+
assert valid? "\x80"
|
1120
|
+
end
|
1121
|
+
|
1122
|
+
it "is always assigned" do
|
1123
|
+
assert assigned? "\x21"
|
1124
|
+
end
|
1125
|
+
|
1126
|
+
it "is control or not" do
|
1127
|
+
assert control? "\x1E"
|
1128
|
+
refute control? "\x67"
|
1129
|
+
end
|
1130
|
+
|
1131
|
+
it "is blank or not" do
|
1132
|
+
assert blank? "\x20"
|
1133
|
+
refute blank? "\x21"
|
1134
|
+
end
|
1135
|
+
|
1136
|
+
it "is separator or not" do
|
1137
|
+
assert separator? "\n"
|
1138
|
+
refute separator? "\x20"
|
1139
|
+
end
|
1140
|
+
|
1141
|
+
it "is never format" do
|
1142
|
+
refute format? "\x21"
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
it "is never bidi_control" do
|
1146
|
+
refute bidi_control? "\x21"
|
1147
|
+
end
|
1148
|
+
end
|
1149
|
+
|
1150
|
+
describe "IBM737" do
|
1151
|
+
let(:encoding) { "IBM737" }
|
1152
|
+
|
1153
|
+
it "is always valid" do
|
1154
|
+
assert valid? "\x80"
|
1155
|
+
end
|
1156
|
+
|
1157
|
+
it "is always assigned" do
|
1158
|
+
assert assigned? "\x21"
|
1159
|
+
end
|
1160
|
+
|
1161
|
+
it "is control or not" do
|
1162
|
+
assert control? "\x1E"
|
1163
|
+
refute control? "\x67"
|
1164
|
+
end
|
1165
|
+
|
1166
|
+
it "is blank or not" do
|
1167
|
+
assert blank? "\x20"
|
1168
|
+
refute blank? "\x21"
|
1169
|
+
end
|
1170
|
+
|
1171
|
+
it "is separator or not" do
|
1172
|
+
assert separator? "\n"
|
1173
|
+
refute separator? "\x20"
|
1174
|
+
end
|
1175
|
+
|
1176
|
+
it "is never format" do
|
1177
|
+
refute format? "\x21"
|
1178
|
+
end
|
1179
|
+
|
1180
|
+
it "is never bidi_control" do
|
1181
|
+
refute bidi_control? "\x21"
|
1182
|
+
end
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
describe "IBM775" do
|
1186
|
+
let(:encoding) { "IBM775" }
|
1187
|
+
|
1188
|
+
it "is always valid" do
|
1189
|
+
assert valid? "\x80"
|
1190
|
+
end
|
1191
|
+
|
1192
|
+
it "is always assigned" do
|
1193
|
+
assert assigned? "\x21"
|
1194
|
+
end
|
1195
|
+
|
1196
|
+
it "is control or not" do
|
1197
|
+
assert control? "\x1E"
|
1198
|
+
refute control? "\x67"
|
1199
|
+
end
|
1200
|
+
|
1201
|
+
it "is blank or not" do
|
1202
|
+
assert blank? "\x20"
|
1203
|
+
refute blank? "\x21"
|
1204
|
+
end
|
1205
|
+
|
1206
|
+
it "is separator or not" do
|
1207
|
+
assert separator? "\n"
|
1208
|
+
refute separator? "\x20"
|
1209
|
+
end
|
1210
|
+
|
1211
|
+
it "is never format" do
|
1212
|
+
refute format? "\x21"
|
1213
|
+
end
|
1214
|
+
|
1215
|
+
it "is never bidi_control" do
|
1216
|
+
refute bidi_control? "\x21"
|
1217
|
+
end
|
1218
|
+
end
|
1219
|
+
|
1220
|
+
describe "CP850" do
|
1221
|
+
let(:encoding) { "CP850" }
|
1222
|
+
|
1223
|
+
it "is always valid" do
|
1224
|
+
assert valid? "\x80"
|
1225
|
+
end
|
1226
|
+
|
1227
|
+
it "is always assigned" do
|
1228
|
+
assert assigned? "\x21"
|
1229
|
+
end
|
1230
|
+
|
1231
|
+
it "is control or not" do
|
1232
|
+
assert control? "\x1E"
|
1233
|
+
refute control? "\x67"
|
1234
|
+
end
|
1235
|
+
|
1236
|
+
it "is blank or not" do
|
1237
|
+
assert blank? "\x20"
|
1238
|
+
refute blank? "\x21"
|
1239
|
+
end
|
1240
|
+
|
1241
|
+
it "is separator or not" do
|
1242
|
+
assert separator? "\n"
|
1243
|
+
refute separator? "\x20"
|
1244
|
+
end
|
1245
|
+
|
1246
|
+
it "is never format" do
|
1247
|
+
refute format? "\x21"
|
1248
|
+
end
|
1249
|
+
|
1250
|
+
it "is never bidi_control" do
|
1251
|
+
refute bidi_control? "\x21"
|
1252
|
+
end
|
1253
|
+
end
|
1254
|
+
|
1255
|
+
describe "IBM852" do
|
1256
|
+
let(:encoding) { "IBM852" }
|
1257
|
+
|
1258
|
+
it "is always valid" do
|
1259
|
+
assert valid? "\x80"
|
1260
|
+
end
|
1261
|
+
|
1262
|
+
it "is always assigned" do
|
1263
|
+
assert assigned? "\x21"
|
1264
|
+
end
|
1265
|
+
|
1266
|
+
it "is control or not" do
|
1267
|
+
assert control? "\x1E"
|
1268
|
+
refute control? "\x67"
|
1269
|
+
end
|
1270
|
+
|
1271
|
+
it "is blank or not" do
|
1272
|
+
assert blank? "\x20"
|
1273
|
+
refute blank? "\x21"
|
1274
|
+
end
|
1275
|
+
|
1276
|
+
it "is separator or not" do
|
1277
|
+
assert separator? "\n"
|
1278
|
+
refute separator? "\x20"
|
1279
|
+
end
|
1280
|
+
|
1281
|
+
it "is never format" do
|
1282
|
+
refute format? "\x21"
|
1283
|
+
end
|
1284
|
+
|
1285
|
+
it "is never bidi_control" do
|
1286
|
+
refute bidi_control? "\x21"
|
1287
|
+
end
|
1288
|
+
end
|
1289
|
+
|
1290
|
+
describe "CP852" do
|
1291
|
+
let(:encoding) { "CP852" }
|
1292
|
+
|
1293
|
+
it "is always valid" do
|
1294
|
+
assert valid? "\x80"
|
1295
|
+
end
|
1296
|
+
|
1297
|
+
it "is always assigned" do
|
1298
|
+
assert assigned? "\x21"
|
1299
|
+
end
|
1300
|
+
|
1301
|
+
it "is control or not" do
|
1302
|
+
assert control? "\x1E"
|
1303
|
+
refute control? "\x67"
|
1304
|
+
end
|
1305
|
+
|
1306
|
+
it "is blank or not" do
|
1307
|
+
assert blank? "\x20"
|
1308
|
+
refute blank? "\x21"
|
1309
|
+
end
|
1310
|
+
|
1311
|
+
it "is separator or not" do
|
1312
|
+
assert separator? "\n"
|
1313
|
+
refute separator? "\x20"
|
1314
|
+
end
|
1315
|
+
|
1316
|
+
it "is never format" do
|
1317
|
+
refute format? "\x21"
|
1318
|
+
end
|
1319
|
+
|
1320
|
+
it "is never bidi_control" do
|
1321
|
+
refute bidi_control? "\x21"
|
1322
|
+
end
|
1323
|
+
end
|
1324
|
+
|
1325
|
+
describe "IBM855" do
|
1326
|
+
let(:encoding) { "IBM855" }
|
1327
|
+
|
1328
|
+
it "is always valid" do
|
1329
|
+
assert valid? "\x80"
|
1330
|
+
end
|
1331
|
+
|
1332
|
+
it "is always assigned" do
|
1333
|
+
assert assigned? "\x21"
|
1334
|
+
end
|
1335
|
+
|
1336
|
+
it "is control or not" do
|
1337
|
+
assert control? "\x1E"
|
1338
|
+
refute control? "\x67"
|
1339
|
+
end
|
1340
|
+
|
1341
|
+
it "is blank or not" do
|
1342
|
+
assert blank? "\x20"
|
1343
|
+
refute blank? "\x21"
|
1344
|
+
end
|
1345
|
+
|
1346
|
+
it "is separator or not" do
|
1347
|
+
assert separator? "\n"
|
1348
|
+
refute separator? "\x20"
|
1349
|
+
end
|
1350
|
+
|
1351
|
+
it "is never format" do
|
1352
|
+
refute format? "\x21"
|
1353
|
+
end
|
1354
|
+
|
1355
|
+
it "is never bidi_control" do
|
1356
|
+
refute bidi_control? "\x21"
|
1357
|
+
end
|
1358
|
+
end
|
1359
|
+
|
1360
|
+
describe "CP855" do
|
1361
|
+
let(:encoding) { "CP855" }
|
1362
|
+
|
1363
|
+
it "is always valid" do
|
1364
|
+
assert valid? "\x80"
|
1365
|
+
end
|
1366
|
+
|
1367
|
+
it "is always assigned" do
|
1368
|
+
assert assigned? "\x21"
|
1369
|
+
end
|
1370
|
+
|
1371
|
+
it "is control or not" do
|
1372
|
+
assert control? "\x1E"
|
1373
|
+
refute control? "\x67"
|
1374
|
+
end
|
1375
|
+
|
1376
|
+
it "is blank or not" do
|
1377
|
+
assert blank? "\x20"
|
1378
|
+
refute blank? "\x21"
|
1379
|
+
end
|
1380
|
+
|
1381
|
+
it "is separator or not" do
|
1382
|
+
assert separator? "\n"
|
1383
|
+
refute separator? "\x20"
|
1384
|
+
end
|
1385
|
+
|
1386
|
+
it "is never format" do
|
1387
|
+
refute format? "\x21"
|
1388
|
+
end
|
1389
|
+
|
1390
|
+
it "is never bidi_control" do
|
1391
|
+
refute bidi_control? "\x21"
|
1392
|
+
end
|
1393
|
+
end
|
1394
|
+
|
1395
|
+
describe "IBM857" do
|
1396
|
+
let(:encoding) { "IBM857" }
|
1397
|
+
|
1398
|
+
it "is always valid" do
|
1399
|
+
assert valid? "\x80"
|
1400
|
+
end
|
1401
|
+
|
1402
|
+
it "is assigned or not" do
|
1403
|
+
assert assigned? "\x21"
|
1404
|
+
refute assigned? "\xE7"
|
1405
|
+
end
|
1406
|
+
|
1407
|
+
it "is control or not" do
|
1408
|
+
assert control? "\x1E"
|
1409
|
+
refute control? "\x67"
|
1410
|
+
end
|
1411
|
+
|
1412
|
+
it "is blank or not" do
|
1413
|
+
assert blank? "\x20"
|
1414
|
+
refute blank? "\x21"
|
1415
|
+
end
|
1416
|
+
|
1417
|
+
it "is separator or not" do
|
1418
|
+
assert separator? "\n"
|
1419
|
+
refute separator? "\x20"
|
1420
|
+
end
|
1421
|
+
|
1422
|
+
it "is never format" do
|
1423
|
+
refute format? "\x21"
|
1424
|
+
end
|
1425
|
+
|
1426
|
+
it "is never bidi_control" do
|
1427
|
+
refute bidi_control? "\x21"
|
1428
|
+
end
|
1429
|
+
end
|
1430
|
+
|
1431
|
+
describe "IBM860" do
|
1432
|
+
let(:encoding) { "IBM860" }
|
1433
|
+
|
1434
|
+
it "is always valid" do
|
1435
|
+
assert valid? "\x80"
|
1436
|
+
end
|
1437
|
+
|
1438
|
+
it "is always assigned" do
|
1439
|
+
assert assigned? "\x21"
|
1440
|
+
end
|
1441
|
+
|
1442
|
+
it "is control or not" do
|
1443
|
+
assert control? "\x1E"
|
1444
|
+
refute control? "\x67"
|
1445
|
+
end
|
1446
|
+
|
1447
|
+
it "is blank or not" do
|
1448
|
+
assert blank? "\x20"
|
1449
|
+
refute blank? "\x21"
|
1450
|
+
end
|
1451
|
+
|
1452
|
+
it "is separator or not" do
|
1453
|
+
assert separator? "\n"
|
1454
|
+
refute separator? "\x20"
|
1455
|
+
end
|
1456
|
+
|
1457
|
+
it "is never format" do
|
1458
|
+
refute format? "\x21"
|
1459
|
+
end
|
1460
|
+
|
1461
|
+
it "is never bidi_control" do
|
1462
|
+
refute bidi_control? "\x21"
|
1463
|
+
end
|
1464
|
+
end
|
1465
|
+
|
1466
|
+
describe "IBM861" do
|
1467
|
+
let(:encoding) { "IBM861" }
|
1468
|
+
|
1469
|
+
it "is always valid" do
|
1470
|
+
assert valid? "\x80"
|
1471
|
+
end
|
1472
|
+
|
1473
|
+
it "is always assigned" do
|
1474
|
+
assert assigned? "\x21"
|
1475
|
+
end
|
1476
|
+
|
1477
|
+
it "is control or not" do
|
1478
|
+
assert control? "\x1E"
|
1479
|
+
refute control? "\x67"
|
1480
|
+
end
|
1481
|
+
|
1482
|
+
it "is blank or not" do
|
1483
|
+
assert blank? "\x20"
|
1484
|
+
refute blank? "\x21"
|
1485
|
+
end
|
1486
|
+
|
1487
|
+
it "is separator or not" do
|
1488
|
+
assert separator? "\n"
|
1489
|
+
refute separator? "\x20"
|
1490
|
+
end
|
1491
|
+
|
1492
|
+
it "is never format" do
|
1493
|
+
refute format? "\x21"
|
1494
|
+
end
|
1495
|
+
|
1496
|
+
it "is never bidi_control" do
|
1497
|
+
refute bidi_control? "\x21"
|
1498
|
+
end
|
1499
|
+
end
|
1500
|
+
|
1501
|
+
describe "IBM862" do
|
1502
|
+
let(:encoding) { "IBM862" }
|
1503
|
+
|
1504
|
+
it "is always valid" do
|
1505
|
+
assert valid? "\x80"
|
1506
|
+
end
|
1507
|
+
|
1508
|
+
it "is always assigned" do
|
1509
|
+
assert assigned? "\x21"
|
1510
|
+
end
|
1511
|
+
|
1512
|
+
it "is control or not" do
|
1513
|
+
assert control? "\x1E"
|
1514
|
+
refute control? "\x67"
|
1515
|
+
end
|
1516
|
+
|
1517
|
+
it "is blank or not" do
|
1518
|
+
assert blank? "\x20"
|
1519
|
+
refute blank? "\x21"
|
1520
|
+
end
|
1521
|
+
|
1522
|
+
it "is separator or not" do
|
1523
|
+
assert separator? "\n"
|
1524
|
+
refute separator? "\x20"
|
1525
|
+
end
|
1526
|
+
|
1527
|
+
it "is never format" do
|
1528
|
+
refute format? "\x21"
|
1529
|
+
end
|
1530
|
+
|
1531
|
+
it "is never bidi_control" do
|
1532
|
+
refute bidi_control? "\x21"
|
1533
|
+
end
|
1534
|
+
end
|
1535
|
+
|
1536
|
+
describe "IBM863" do
|
1537
|
+
let(:encoding) { "IBM863" }
|
1538
|
+
|
1539
|
+
it "is always valid" do
|
1540
|
+
assert valid? "\x80"
|
1541
|
+
end
|
1542
|
+
|
1543
|
+
it "is always assigned" do
|
1544
|
+
assert assigned? "\x21"
|
1545
|
+
end
|
1546
|
+
|
1547
|
+
it "is control or not" do
|
1548
|
+
assert control? "\x1E"
|
1549
|
+
refute control? "\x67"
|
1550
|
+
end
|
1551
|
+
|
1552
|
+
it "is blank or not" do
|
1553
|
+
assert blank? "\x20"
|
1554
|
+
refute blank? "\x21"
|
1555
|
+
end
|
1556
|
+
|
1557
|
+
it "is separator or not" do
|
1558
|
+
assert separator? "\n"
|
1559
|
+
refute separator? "\x20"
|
1560
|
+
end
|
1561
|
+
|
1562
|
+
it "is never format" do
|
1563
|
+
refute format? "\x21"
|
1564
|
+
end
|
1565
|
+
|
1566
|
+
it "is never bidi_control" do
|
1567
|
+
refute bidi_control? "\x21"
|
1568
|
+
end
|
1569
|
+
end
|
1570
|
+
|
1571
|
+
describe "IBM864" do
|
1572
|
+
let(:encoding) { "IBM864" }
|
1573
|
+
|
1574
|
+
it "is always valid" do
|
1575
|
+
assert valid? "\x80"
|
1576
|
+
end
|
1577
|
+
|
1578
|
+
it "is assigned or not" do
|
1579
|
+
assert assigned? "\x21"
|
1580
|
+
refute assigned? "\xA6"
|
1581
|
+
end
|
1582
|
+
|
1583
|
+
it "is control or not" do
|
1584
|
+
assert control? "\x1E"
|
1585
|
+
refute control? "\x67"
|
1586
|
+
end
|
1587
|
+
|
1588
|
+
it "is blank or not" do
|
1589
|
+
assert blank? "\x20"
|
1590
|
+
refute blank? "\x21"
|
1591
|
+
end
|
1592
|
+
|
1593
|
+
it "is separator or not" do
|
1594
|
+
assert separator? "\n"
|
1595
|
+
refute separator? "\x20"
|
1596
|
+
end
|
1597
|
+
|
1598
|
+
it "is never format" do
|
1599
|
+
refute format? "\x21"
|
1600
|
+
end
|
1601
|
+
|
1602
|
+
it "is never bidi_control" do
|
1603
|
+
refute bidi_control? "\x21"
|
1604
|
+
end
|
1605
|
+
end
|
1606
|
+
|
1607
|
+
describe "IBM865" do
|
1608
|
+
let(:encoding) { "IBM865" }
|
1609
|
+
|
1610
|
+
it "is always valid" do
|
1611
|
+
assert valid? "\x80"
|
1612
|
+
end
|
1613
|
+
|
1614
|
+
it "is always assigned" do
|
1615
|
+
assert assigned? "\x21"
|
1616
|
+
end
|
1617
|
+
|
1618
|
+
it "is control or not" do
|
1619
|
+
assert control? "\x1E"
|
1620
|
+
refute control? "\x67"
|
1621
|
+
end
|
1622
|
+
|
1623
|
+
it "is blank or not" do
|
1624
|
+
assert blank? "\x20"
|
1625
|
+
refute blank? "\x21"
|
1626
|
+
end
|
1627
|
+
|
1628
|
+
it "is separator or not" do
|
1629
|
+
assert separator? "\n"
|
1630
|
+
refute separator? "\x20"
|
1631
|
+
end
|
1632
|
+
|
1633
|
+
it "is never format" do
|
1634
|
+
refute format? "\x21"
|
1635
|
+
end
|
1636
|
+
|
1637
|
+
it "is never bidi_control" do
|
1638
|
+
refute bidi_control? "\x21"
|
1639
|
+
end
|
1640
|
+
end
|
1641
|
+
|
1642
|
+
describe "IBM866" do
|
1643
|
+
let(:encoding) { "IBM866" }
|
1644
|
+
|
1645
|
+
it "is always valid" do
|
1646
|
+
assert valid? "\x80"
|
1647
|
+
end
|
1648
|
+
|
1649
|
+
it "is always assigned" do
|
1650
|
+
assert assigned? "\x21"
|
1651
|
+
end
|
1652
|
+
|
1653
|
+
it "is control or not" do
|
1654
|
+
assert control? "\x1E"
|
1655
|
+
refute control? "\x67"
|
1656
|
+
end
|
1657
|
+
|
1658
|
+
it "is blank or not" do
|
1659
|
+
assert blank? "\x20"
|
1660
|
+
refute blank? "\x21"
|
1661
|
+
end
|
1662
|
+
|
1663
|
+
it "is separator or not" do
|
1664
|
+
assert separator? "\n"
|
1665
|
+
refute separator? "\x20"
|
1666
|
+
end
|
1667
|
+
|
1668
|
+
it "is never format" do
|
1669
|
+
refute format? "\x21"
|
1670
|
+
end
|
1671
|
+
|
1672
|
+
it "is never bidi_control" do
|
1673
|
+
refute bidi_control? "\x21"
|
1674
|
+
end
|
1675
|
+
end
|
1676
|
+
|
1677
|
+
describe "IBM869" do
|
1678
|
+
let(:encoding) { "IBM869" }
|
1679
|
+
|
1680
|
+
it "is always valid" do
|
1681
|
+
assert valid? "\x80"
|
1682
|
+
end
|
1683
|
+
|
1684
|
+
it "is assigned or not" do
|
1685
|
+
assert assigned? "\x21"
|
1686
|
+
refute assigned? "\x80"
|
1687
|
+
end
|
1688
|
+
|
1689
|
+
it "is control or not" do
|
1690
|
+
assert control? "\x1E"
|
1691
|
+
refute control? "\x67"
|
1692
|
+
end
|
1693
|
+
|
1694
|
+
it "is blank or not" do
|
1695
|
+
assert blank? "\x20"
|
1696
|
+
refute blank? "\x21"
|
1697
|
+
end
|
1698
|
+
|
1699
|
+
it "is separator or not" do
|
1700
|
+
assert separator? "\n"
|
1701
|
+
refute separator? "\x20"
|
1702
|
+
end
|
1703
|
+
|
1704
|
+
it "is never format" do
|
1705
|
+
refute format? "\x21"
|
1706
|
+
end
|
1707
|
+
|
1708
|
+
it "is never bidi_control" do
|
1709
|
+
refute bidi_control? "\x21"
|
1710
|
+
end
|
1711
|
+
end
|
1712
|
+
end
|
1713
|
+
|
1714
|
+
describe "mac*" do
|
1715
|
+
describe "macCentEuro" do
|
1716
|
+
let(:encoding) { "macCentEuro" }
|
1717
|
+
|
1718
|
+
it "is always valid" do
|
1719
|
+
assert valid? "\x80"
|
1720
|
+
end
|
1721
|
+
|
1722
|
+
it "is always assigned" do
|
1723
|
+
assert assigned? "\x21"
|
1724
|
+
end
|
1725
|
+
|
1726
|
+
it "is control or not" do
|
1727
|
+
assert control? "\x1E"
|
1728
|
+
refute control? "\x67"
|
1729
|
+
end
|
1730
|
+
|
1731
|
+
it "is blank or not" do
|
1732
|
+
assert blank? "\x20"
|
1733
|
+
refute blank? "\x21"
|
1734
|
+
end
|
1735
|
+
|
1736
|
+
it "is separator or not" do
|
1737
|
+
assert separator? "\n"
|
1738
|
+
refute separator? "\x20"
|
1739
|
+
end
|
1740
|
+
|
1741
|
+
it "is never format" do
|
1742
|
+
refute format? "\x21"
|
1743
|
+
end
|
1744
|
+
|
1745
|
+
it "is never bidi_control" do
|
1746
|
+
refute bidi_control? "\x21"
|
1747
|
+
end
|
1748
|
+
end
|
1749
|
+
|
1750
|
+
describe "macCroatian" do
|
1751
|
+
let(:encoding) { "macCroatian" }
|
1752
|
+
|
1753
|
+
it "is always valid" do
|
1754
|
+
assert valid? "\x80"
|
1755
|
+
end
|
1756
|
+
|
1757
|
+
it "is always assigned" do
|
1758
|
+
assert assigned? "\x21"
|
1759
|
+
end
|
1760
|
+
|
1761
|
+
it "is control or not" do
|
1762
|
+
assert control? "\x1E"
|
1763
|
+
refute control? "\x67"
|
1764
|
+
end
|
1765
|
+
|
1766
|
+
it "is blank or not" do
|
1767
|
+
assert blank? "\x20"
|
1768
|
+
refute blank? "\x21"
|
1769
|
+
end
|
1770
|
+
|
1771
|
+
it "is separator or not" do
|
1772
|
+
assert separator? "\n"
|
1773
|
+
refute separator? "\x20"
|
1774
|
+
end
|
1775
|
+
|
1776
|
+
it "is never format" do
|
1777
|
+
refute format? "\x21"
|
1778
|
+
end
|
1779
|
+
|
1780
|
+
it "is never bidi_control" do
|
1781
|
+
refute bidi_control? "\x21"
|
1782
|
+
end
|
1783
|
+
end
|
1784
|
+
|
1785
|
+
describe "macCyrillic" do
|
1786
|
+
let(:encoding) { "macCyrillic" }
|
1787
|
+
|
1788
|
+
it "is always valid" do
|
1789
|
+
assert valid? "\x80"
|
1790
|
+
end
|
1791
|
+
|
1792
|
+
it "is always assigned" do
|
1793
|
+
assert assigned? "\x21"
|
1794
|
+
end
|
1795
|
+
|
1796
|
+
it "is control or not" do
|
1797
|
+
assert control? "\x1E"
|
1798
|
+
refute control? "\x67"
|
1799
|
+
end
|
1800
|
+
|
1801
|
+
it "is blank or not" do
|
1802
|
+
assert blank? "\x20"
|
1803
|
+
refute blank? "\x21"
|
1804
|
+
end
|
1805
|
+
|
1806
|
+
it "is separator or not" do
|
1807
|
+
assert separator? "\n"
|
1808
|
+
refute separator? "\x20"
|
1809
|
+
end
|
1810
|
+
|
1811
|
+
it "is never format" do
|
1812
|
+
refute format? "\x21"
|
1813
|
+
end
|
1814
|
+
|
1815
|
+
it "is never bidi_control" do
|
1816
|
+
refute bidi_control? "\x21"
|
1817
|
+
end
|
1818
|
+
end
|
1819
|
+
|
1820
|
+
describe "macGreek" do
|
1821
|
+
let(:encoding) { "macGreek" }
|
1822
|
+
|
1823
|
+
it "is always valid" do
|
1824
|
+
assert valid? "\x80"
|
1825
|
+
end
|
1826
|
+
|
1827
|
+
it "is always assigned" do
|
1828
|
+
assert assigned? "\x21"
|
1829
|
+
end
|
1830
|
+
|
1831
|
+
it "is control or not" do
|
1832
|
+
assert control? "\x1E"
|
1833
|
+
refute control? "\x67"
|
1834
|
+
end
|
1835
|
+
|
1836
|
+
it "is blank or not" do
|
1837
|
+
assert blank? "\x20"
|
1838
|
+
refute blank? "\x21"
|
1839
|
+
end
|
1840
|
+
|
1841
|
+
it "is separator or not" do
|
1842
|
+
assert separator? "\n"
|
1843
|
+
refute separator? "\x20"
|
1844
|
+
end
|
1845
|
+
|
1846
|
+
it "is never format" do
|
1847
|
+
refute format? "\x21"
|
1848
|
+
end
|
1849
|
+
|
1850
|
+
it "is never bidi_control" do
|
1851
|
+
refute bidi_control? "\x21"
|
1852
|
+
end
|
1853
|
+
end
|
1854
|
+
|
1855
|
+
describe "macIceland" do
|
1856
|
+
let(:encoding) { "macIceland" }
|
1857
|
+
|
1858
|
+
it "is always valid" do
|
1859
|
+
assert valid? "\x80"
|
1860
|
+
end
|
1861
|
+
|
1862
|
+
it "is always assigned" do
|
1863
|
+
assert assigned? "\x21"
|
1864
|
+
end
|
1865
|
+
|
1866
|
+
it "is control or not" do
|
1867
|
+
assert control? "\x1E"
|
1868
|
+
refute control? "\x67"
|
1869
|
+
end
|
1870
|
+
|
1871
|
+
it "is blank or not" do
|
1872
|
+
assert blank? "\x20"
|
1873
|
+
refute blank? "\x21"
|
1874
|
+
end
|
1875
|
+
|
1876
|
+
it "is separator or not" do
|
1877
|
+
assert separator? "\n"
|
1878
|
+
refute separator? "\x20"
|
1879
|
+
end
|
1880
|
+
|
1881
|
+
it "is never format" do
|
1882
|
+
refute format? "\x21"
|
1883
|
+
end
|
1884
|
+
|
1885
|
+
it "is never bidi_control" do
|
1886
|
+
refute bidi_control? "\x21"
|
1887
|
+
end
|
1888
|
+
end
|
1889
|
+
|
1890
|
+
describe "macRoman" do
|
1891
|
+
let(:encoding) { "macRoman" }
|
1892
|
+
|
1893
|
+
it "is always valid" do
|
1894
|
+
assert valid? "\x80"
|
1895
|
+
end
|
1896
|
+
|
1897
|
+
it "is always assigned" do
|
1898
|
+
assert assigned? "\x21"
|
1899
|
+
end
|
1900
|
+
|
1901
|
+
it "is control or not" do
|
1902
|
+
assert control? "\x1E"
|
1903
|
+
refute control? "\x67"
|
1904
|
+
end
|
1905
|
+
|
1906
|
+
it "is blank or not" do
|
1907
|
+
assert blank? "\x20"
|
1908
|
+
refute blank? "\x21"
|
1909
|
+
end
|
1910
|
+
|
1911
|
+
it "is separator or not" do
|
1912
|
+
assert separator? "\n"
|
1913
|
+
refute separator? "\x20"
|
1914
|
+
end
|
1915
|
+
|
1916
|
+
it "is never format" do
|
1917
|
+
refute format? "\x21"
|
1918
|
+
end
|
1919
|
+
|
1920
|
+
it "is never bidi_control" do
|
1921
|
+
refute bidi_control? "\x21"
|
1922
|
+
end
|
1923
|
+
end
|
1924
|
+
|
1925
|
+
describe "macRomania" do
|
1926
|
+
let(:encoding) { "macRomania" }
|
1927
|
+
|
1928
|
+
it "is always valid" do
|
1929
|
+
assert valid? "\x80"
|
1930
|
+
end
|
1931
|
+
|
1932
|
+
it "is always assigned" do
|
1933
|
+
assert assigned? "\x21"
|
1934
|
+
end
|
1935
|
+
|
1936
|
+
it "is control or not" do
|
1937
|
+
assert control? "\x1E"
|
1938
|
+
refute control? "\x67"
|
1939
|
+
end
|
1940
|
+
|
1941
|
+
it "is blank or not" do
|
1942
|
+
assert blank? "\x20"
|
1943
|
+
refute blank? "\x21"
|
1944
|
+
end
|
1945
|
+
|
1946
|
+
it "is separator or not" do
|
1947
|
+
assert separator? "\n"
|
1948
|
+
refute separator? "\x20"
|
1949
|
+
end
|
1950
|
+
|
1951
|
+
it "is never format" do
|
1952
|
+
refute format? "\x21"
|
1953
|
+
end
|
1954
|
+
|
1955
|
+
it "is never bidi_control" do
|
1956
|
+
refute bidi_control? "\x21"
|
1957
|
+
end
|
1958
|
+
end
|
1959
|
+
|
1960
|
+
describe "macThai" do
|
1961
|
+
let(:encoding) { "macThai" }
|
1962
|
+
|
1963
|
+
it "is always valid" do
|
1964
|
+
assert valid? "\x80"
|
1965
|
+
end
|
1966
|
+
|
1967
|
+
it "is assigned or not" do
|
1968
|
+
assert assigned? "\x21"
|
1969
|
+
refute assigned? "\xFC"
|
1970
|
+
end
|
1971
|
+
|
1972
|
+
it "is control or not" do
|
1973
|
+
assert control? "\x1E"
|
1974
|
+
refute control? "\x67"
|
1975
|
+
end
|
1976
|
+
|
1977
|
+
it "is blank or not" do
|
1978
|
+
assert blank? "\x20"
|
1979
|
+
refute blank? "\x21"
|
1980
|
+
end
|
1981
|
+
|
1982
|
+
it "is separator or not" do
|
1983
|
+
assert separator? "\n"
|
1984
|
+
refute separator? "\x20"
|
1985
|
+
end
|
1986
|
+
|
1987
|
+
it "is never format" do
|
1988
|
+
refute format? "\x21"
|
1989
|
+
end
|
1990
|
+
|
1991
|
+
it "is never bidi_control" do
|
1992
|
+
refute bidi_control? "\x21"
|
1993
|
+
end
|
1994
|
+
end
|
1995
|
+
|
1996
|
+
describe "macTurkish" do
|
1997
|
+
let(:encoding) { "macTurkish" }
|
1998
|
+
|
1999
|
+
it "is always valid" do
|
2000
|
+
assert valid? "\x80"
|
2001
|
+
end
|
2002
|
+
|
2003
|
+
it "is assigned or not" do
|
2004
|
+
assert assigned? "\x21"
|
2005
|
+
refute assigned? "\xF5"
|
2006
|
+
end
|
2007
|
+
|
2008
|
+
it "is control or not" do
|
2009
|
+
assert control? "\x1E"
|
2010
|
+
refute control? "\x67"
|
2011
|
+
end
|
2012
|
+
|
2013
|
+
it "is blank or not" do
|
2014
|
+
assert blank? "\x20"
|
2015
|
+
refute blank? "\x21"
|
2016
|
+
end
|
2017
|
+
|
2018
|
+
it "is separator or not" do
|
2019
|
+
assert separator? "\n"
|
2020
|
+
refute separator? "\x20"
|
2021
|
+
end
|
2022
|
+
|
2023
|
+
it "is never format" do
|
2024
|
+
refute format? "\x21"
|
2025
|
+
end
|
2026
|
+
|
2027
|
+
it "is never bidi_control" do
|
2028
|
+
refute bidi_control? "\x21"
|
2029
|
+
end
|
2030
|
+
end
|
2031
|
+
|
2032
|
+
describe "macUkraine" do
|
2033
|
+
let(:encoding) { "macUkraine" }
|
2034
|
+
|
2035
|
+
it "is always valid" do
|
2036
|
+
assert valid? "\x80"
|
2037
|
+
end
|
2038
|
+
|
2039
|
+
it "is always assigned" do
|
2040
|
+
assert assigned? "\x21"
|
2041
|
+
end
|
2042
|
+
|
2043
|
+
it "is control or not" do
|
2044
|
+
assert control? "\x1E"
|
2045
|
+
refute control? "\x67"
|
2046
|
+
end
|
2047
|
+
|
2048
|
+
it "is blank or not" do
|
2049
|
+
assert blank? "\x20"
|
2050
|
+
refute blank? "\x21"
|
2051
|
+
end
|
2052
|
+
|
2053
|
+
it "is separator or not" do
|
2054
|
+
assert separator? "\n"
|
2055
|
+
refute separator? "\x20"
|
2056
|
+
end
|
2057
|
+
|
2058
|
+
it "is never format" do
|
2059
|
+
refute format? "\x21"
|
2060
|
+
end
|
2061
|
+
|
2062
|
+
it "is never bidi_control" do
|
2063
|
+
refute bidi_control? "\x21"
|
2064
|
+
end
|
2065
|
+
end
|
2066
|
+
|
2067
|
+
end
|
2068
|
+
|
2069
|
+
describe "TIS-620/Windows-874" do
|
2070
|
+
describe "TIS-620" do
|
2071
|
+
let(:encoding) { "TIS-620" }
|
2072
|
+
|
2073
|
+
it "is always valid" do
|
2074
|
+
assert valid? "\x80"
|
2075
|
+
end
|
2076
|
+
|
2077
|
+
it "is assigned or not" do
|
2078
|
+
assert assigned? "\x21"
|
2079
|
+
refute assigned? "\xA0"
|
2080
|
+
end
|
2081
|
+
|
2082
|
+
it "is control or not" do
|
2083
|
+
assert control? "\x1E"
|
2084
|
+
refute control? "\x67"
|
2085
|
+
end
|
2086
|
+
|
2087
|
+
it "is blank or not" do
|
2088
|
+
assert blank? "\x20"
|
2089
|
+
refute blank? "\x21"
|
2090
|
+
end
|
2091
|
+
|
2092
|
+
it "is separator or not" do
|
2093
|
+
assert separator? "\n"
|
2094
|
+
refute separator? "\x20"
|
2095
|
+
end
|
2096
|
+
|
2097
|
+
it "is never format" do
|
2098
|
+
refute format? "\x21"
|
2099
|
+
end
|
2100
|
+
|
2101
|
+
it "is never bidi_control" do
|
2102
|
+
refute bidi_control? "\x21"
|
2103
|
+
end
|
2104
|
+
end
|
2105
|
+
|
2106
|
+
describe "Windows-874" do
|
2107
|
+
let(:encoding) { "Windows-874" }
|
2108
|
+
|
2109
|
+
it "is always valid" do
|
2110
|
+
assert valid? "\x80"
|
2111
|
+
end
|
2112
|
+
|
2113
|
+
it "is assigned or not" do
|
2114
|
+
assert assigned? "\xA0"
|
2115
|
+
refute assigned? "\x99"
|
2116
|
+
end
|
2117
|
+
|
2118
|
+
it "is control or not" do
|
2119
|
+
assert control? "\x1E"
|
2120
|
+
refute control? "\x67"
|
2121
|
+
end
|
2122
|
+
|
2123
|
+
it "is blank or not" do
|
2124
|
+
assert blank? "\x20"
|
2125
|
+
refute blank? "\x21"
|
2126
|
+
end
|
2127
|
+
|
2128
|
+
it "is separator or not" do
|
2129
|
+
assert separator? "\n"
|
2130
|
+
refute separator? "\x20"
|
2131
|
+
end
|
2132
|
+
|
2133
|
+
it "is never format" do
|
2134
|
+
refute format? "\x21"
|
2135
|
+
end
|
2136
|
+
|
2137
|
+
it "is never bidi_control" do
|
2138
|
+
refute bidi_control? "\x21"
|
2139
|
+
end
|
2140
|
+
end
|
2141
|
+
end
|
2142
|
+
|
2143
|
+
describe "KOI8-*" do
|
2144
|
+
describe "KOI8-R" do
|
2145
|
+
let(:encoding) { "KOI8-R" }
|
2146
|
+
|
2147
|
+
it "is always valid" do
|
2148
|
+
assert valid? "\x80"
|
2149
|
+
end
|
2150
|
+
|
2151
|
+
it "is always assigned" do
|
2152
|
+
assert assigned? "\x21"
|
2153
|
+
end
|
2154
|
+
|
2155
|
+
it "is control or not" do
|
2156
|
+
assert control? "\x1E"
|
2157
|
+
refute control? "\x67"
|
2158
|
+
end
|
2159
|
+
|
2160
|
+
it "is blank or not" do
|
2161
|
+
assert blank? "\x20"
|
2162
|
+
refute blank? "\x21"
|
2163
|
+
end
|
2164
|
+
|
2165
|
+
it "is separator or not" do
|
2166
|
+
assert separator? "\n"
|
2167
|
+
refute separator? "\x20"
|
2168
|
+
end
|
2169
|
+
|
2170
|
+
it "is never format" do
|
2171
|
+
refute format? "\x21"
|
2172
|
+
end
|
2173
|
+
|
2174
|
+
it "is never bidi_control" do
|
2175
|
+
refute bidi_control? "\x21"
|
2176
|
+
end
|
2177
|
+
end
|
2178
|
+
|
2179
|
+
describe "KOI8-U" do
|
2180
|
+
let(:encoding) { "KOI8-U" }
|
2181
|
+
|
2182
|
+
it "is always valid" do
|
2183
|
+
assert valid? "\x80"
|
2184
|
+
end
|
2185
|
+
|
2186
|
+
it "is always assigned" do
|
2187
|
+
assert assigned? "\x21"
|
2188
|
+
end
|
2189
|
+
|
2190
|
+
it "is control or not" do
|
2191
|
+
assert control? "\x1E"
|
2192
|
+
refute control? "\x67"
|
2193
|
+
end
|
2194
|
+
|
2195
|
+
it "is blank or not" do
|
2196
|
+
assert blank? "\x20"
|
2197
|
+
refute blank? "\x21"
|
2198
|
+
end
|
2199
|
+
|
2200
|
+
it "is separator or not" do
|
2201
|
+
assert separator? "\n"
|
2202
|
+
refute separator? "\x20"
|
2203
|
+
end
|
2204
|
+
|
459
2205
|
it "is never format" do
|
460
2206
|
refute format? "\x21"
|
461
2207
|
end
|