@natlibfi/marc-record-validators-melinda 12.0.0-alpha.6 → 12.0.0-alpha.7
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.
- package/dist/ending-punctuation-conf.js +3 -2
- package/dist/ending-punctuation-conf.js.map +2 -2
- package/dist/ending-punctuation.js +42 -11
- package/dist/ending-punctuation.js.map +2 -2
- package/dist/ending-punctuation.test.js +169 -96
- package/dist/ending-punctuation.test.js.map +2 -2
- package/package.json +1 -1
- package/src/ending-punctuation-conf.js +3 -2
- package/src/ending-punctuation.js +56 -16
- package/src/ending-punctuation.test.js +156 -97
|
@@ -17,10 +17,18 @@ describe('ending-punctuation', () => {
|
|
|
17
17
|
ind1: ' ',
|
|
18
18
|
ind2: ' ',
|
|
19
19
|
subfields: [
|
|
20
|
-
{code: 'a', value: 'Elämäni ja tutkimusretkeni /
|
|
20
|
+
{code: 'a', value: 'Elämäni ja tutkimusretkeni /'},
|
|
21
21
|
{code: 'c', value: 'Roald Amundsen ; suomentanut Sulo Veikko Pekkola.'},
|
|
22
22
|
{code: '6', value: 'FOO'}
|
|
23
23
|
]
|
|
24
|
+
}, { // Hackily putting 2nd 245 here
|
|
25
|
+
tag: '245',
|
|
26
|
+
ind1: '0',
|
|
27
|
+
ind2: '4',
|
|
28
|
+
subfields: [
|
|
29
|
+
{code: 'a', value: 'The Disaster /'},
|
|
30
|
+
{code: 'c', value: '(J.L.).'}
|
|
31
|
+
]
|
|
24
32
|
}, {
|
|
25
33
|
tag: '337', // Range 336-338
|
|
26
34
|
ind1: ' ',
|
|
@@ -34,7 +42,18 @@ describe('ending-punctuation', () => {
|
|
|
34
42
|
tag: '500', // Range 500-509
|
|
35
43
|
ind1: ' ',
|
|
36
44
|
ind2: ' ',
|
|
37
|
-
subfields: [{code: 'a', value: 'FOO (Bar)'}]
|
|
45
|
+
subfields: [{code: 'a', value: 'FOO (Bar).'}]
|
|
46
|
+
}, {
|
|
47
|
+
tag: '500', // Range 500-509
|
|
48
|
+
ind1: ' ',
|
|
49
|
+
ind2: ' ',
|
|
50
|
+
subfields: [{code: 'a', value: '"Lorum ipsum."'}]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
tag: '500', // Range 500-509
|
|
54
|
+
ind1: ' ',
|
|
55
|
+
ind2: ' ',
|
|
56
|
+
subfields: [{code: 'a', value: 'Foo "Bar".'}]
|
|
38
57
|
}
|
|
39
58
|
]
|
|
40
59
|
});
|
|
@@ -47,9 +66,17 @@ describe('ending-punctuation', () => {
|
|
|
47
66
|
ind1: ' ',
|
|
48
67
|
ind2: ' ',
|
|
49
68
|
subfields: [
|
|
50
|
-
{code: 'a', value: 'Elämäni ja tutkimusretkeni /
|
|
69
|
+
{code: 'a', value: 'Elämäni ja tutkimusretkeni /'},
|
|
51
70
|
{code: 'c', value: 'Roald Amundsen ; suomentanut Sulo Veikko Pekkola'},
|
|
52
|
-
{code: '6', value: 'FOO'}
|
|
71
|
+
{code: '6', value: 'FOO'} // NV: not changing this now, but this is wrong: $6 is *always* the first subfield. Also , the value is not valid for $6...
|
|
72
|
+
]
|
|
73
|
+
}, { // Hackily putting 2nd 245 here
|
|
74
|
+
tag: '245',
|
|
75
|
+
ind1: '0',
|
|
76
|
+
ind2: '4',
|
|
77
|
+
subfields: [
|
|
78
|
+
{code: 'a', value: 'The Disaster /'},
|
|
79
|
+
{code: 'c', value: '(J.L.)'}
|
|
53
80
|
]
|
|
54
81
|
}, {
|
|
55
82
|
tag: '337',
|
|
@@ -57,14 +84,25 @@ describe('ending-punctuation', () => {
|
|
|
57
84
|
ind2: ' ',
|
|
58
85
|
subfields: [
|
|
59
86
|
{code: 'a', value: 'käytettävissä ilman laitetta'},
|
|
60
|
-
{code: 'b', value: 'n.'}, // This can be abbreviation -> does not generate error
|
|
87
|
+
{code: 'b', value: 'n.'}, // This can be abbreviation -> does not generate error (NV: huh?!?)
|
|
61
88
|
{code: '2', value: 'rdamedia'}
|
|
62
89
|
]
|
|
63
90
|
}, {
|
|
64
91
|
tag: '500',
|
|
65
92
|
ind1: ' ',
|
|
66
93
|
ind2: ' ',
|
|
67
|
-
subfields: [{code: 'a', value: 'FOO (Bar)
|
|
94
|
+
subfields: [{code: 'a', value: 'FOO (Bar)'}]
|
|
95
|
+
}, {
|
|
96
|
+
tag: '500', // Range 500-509
|
|
97
|
+
ind1: ' ',
|
|
98
|
+
ind2: ' ',
|
|
99
|
+
subfields: [{code: 'a', value: '"Lorum ipsum.".'}]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
tag: '500', // Range 500-509
|
|
103
|
+
ind1: ' ',
|
|
104
|
+
ind2: ' ',
|
|
105
|
+
subfields: [{code: 'a', value: 'Foo "Bar"'}]
|
|
68
106
|
}
|
|
69
107
|
]
|
|
70
108
|
});
|
|
@@ -76,24 +114,43 @@ describe('ending-punctuation', () => {
|
|
|
76
114
|
ind1: ' ',
|
|
77
115
|
ind2: ' ',
|
|
78
116
|
subfields: [
|
|
79
|
-
{code: 'a', value: 'Elämäni ja tutkimusretkeni /
|
|
117
|
+
{code: 'a', value: 'Elämäni ja tutkimusretkeni /'},
|
|
80
118
|
{code: 'c', value: 'Roald Amundsen ; suomentanut Sulo Veikko Pekkola'},
|
|
81
119
|
{code: '6', value: 'FOO'}
|
|
82
120
|
]
|
|
121
|
+
}, { // Hackily putting 2nd 245 here
|
|
122
|
+
tag: '245',
|
|
123
|
+
ind1: '0',
|
|
124
|
+
ind2: '4',
|
|
125
|
+
subfields: [
|
|
126
|
+
{code: 'a', value: 'The Disaster /'},
|
|
127
|
+
{code: 'c', value: '(J.L.)'}
|
|
128
|
+
]
|
|
83
129
|
}, {
|
|
84
130
|
tag: '337',
|
|
85
131
|
ind1: ' ',
|
|
86
132
|
ind2: ' ',
|
|
87
133
|
subfields: [
|
|
88
134
|
{code: 'a', value: 'käytettävissä ilman laitetta'},
|
|
89
|
-
{code: 'b', value: 'n'}, // Dot removed from possible abbreviation as it cannot be removed in fixing
|
|
135
|
+
{code: 'b', value: 'n'}, // Dot removed from possible abbreviation as it cannot be removed in fixing (NV: huh?)
|
|
90
136
|
{code: '2', value: 'rdamedia'}
|
|
91
137
|
]
|
|
92
138
|
}, {
|
|
93
139
|
tag: '500',
|
|
94
140
|
ind1: ' ',
|
|
95
141
|
ind2: ' ',
|
|
96
|
-
subfields: [{code: 'a', value: 'FOO (Bar)
|
|
142
|
+
subfields: [{code: 'a', value: 'FOO (Bar)'}]
|
|
143
|
+
}, {
|
|
144
|
+
tag: '500', // Range 500-509
|
|
145
|
+
ind1: ' ',
|
|
146
|
+
ind2: ' ',
|
|
147
|
+
subfields: [{code: 'a', value: '"Lorum ipsum.".'}]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
tag: '500', // Range 500-509
|
|
151
|
+
ind1: ' ',
|
|
152
|
+
ind2: ' ',
|
|
153
|
+
subfields: [{code: 'a', value: 'Foo "Bar"'}]
|
|
97
154
|
}
|
|
98
155
|
]
|
|
99
156
|
});
|
|
@@ -101,6 +158,7 @@ describe('ending-punctuation', () => {
|
|
|
101
158
|
it('Finds the record valid', async () => {
|
|
102
159
|
const validator = await validatorFactory();
|
|
103
160
|
const result = await validator.validate(recordValid);
|
|
161
|
+
//console.info(JSON.stringify(result));
|
|
104
162
|
assert.equal(result.valid, true);
|
|
105
163
|
});
|
|
106
164
|
|
|
@@ -108,7 +166,7 @@ describe('ending-punctuation', () => {
|
|
|
108
166
|
const validator = await validatorFactory();
|
|
109
167
|
const result = await validator.validate(recordInvalid);
|
|
110
168
|
assert.deepEqual(result, {
|
|
111
|
-
message: ['Field 245
|
|
169
|
+
message: ['Field 245 requires ending punctuation, ends in \'a\'', 'Field 245 requires ending punctuation, ends in \')\'', 'Field 500 requires ending punctuation, ends in \')\'', 'Field 500 has an extra dot in \'.".\'', 'Field 500 requires ending punctuation, ends in \'"\''],
|
|
112
170
|
valid: false
|
|
113
171
|
});
|
|
114
172
|
});
|
|
@@ -116,12 +174,13 @@ describe('ending-punctuation', () => {
|
|
|
116
174
|
it('Repairs the invalid record', async () => {
|
|
117
175
|
const validator = await validatorFactory();
|
|
118
176
|
const result = await validator.fix(recordBroken);
|
|
119
|
-
|
|
177
|
+
|
|
120
178
|
assert.deepEqual(result, {
|
|
121
|
-
message: ['Field 245
|
|
122
|
-
fix: ['Field 245 - Added punctuation to $c', 'Field 500 - Removed
|
|
179
|
+
message: ['Field 245 requires ending punctuation, ends in \'a\'', 'Field 245 requires ending punctuation, ends in \')\'', 'Field 500 requires ending punctuation, ends in \')\'', 'Field 500 has an extra dot in \'.".\'', 'Field 500 requires ending punctuation, ends in \'"\''],
|
|
180
|
+
fix: ['Field 245 - Added punctuation to $c', 'Field 245 - Added punctuation to $c', 'Field 500 - Added punctuation to $a', 'Field 500 - Removed \'.\' after \'."\'', 'Field 500 - Added punctuation to $a'],
|
|
123
181
|
valid: false
|
|
124
182
|
});
|
|
183
|
+
assert.equal(recordBroken.equalsTo(recordValid), true);
|
|
125
184
|
});
|
|
126
185
|
});
|
|
127
186
|
|
|
@@ -201,7 +260,7 @@ describe('ending-punctuation', () => {
|
|
|
201
260
|
const validator = await validatorFactory();
|
|
202
261
|
const result = await validator.validate(recordInvalid);
|
|
203
262
|
assert.deepEqual(result, {
|
|
204
|
-
message: ['Field 036
|
|
263
|
+
message: ['Field 036 requires ending punctuation, ends in \'e\''],
|
|
205
264
|
valid: false
|
|
206
265
|
});
|
|
207
266
|
});
|
|
@@ -210,7 +269,7 @@ describe('ending-punctuation', () => {
|
|
|
210
269
|
const validator = await validatorFactory();
|
|
211
270
|
const result = await validator.validate(recordInvalidOnlyA);
|
|
212
271
|
assert.deepEqual(result, {
|
|
213
|
-
message: ['Field 036 has
|
|
272
|
+
message: ['Field 036 has unwanted ending punctuation \'.\''],
|
|
214
273
|
valid: false
|
|
215
274
|
});
|
|
216
275
|
});
|
|
@@ -221,7 +280,7 @@ describe('ending-punctuation', () => {
|
|
|
221
280
|
const result = await validator.fix(recordInvalid);
|
|
222
281
|
assert.equal(recordInvalid.equalsTo(recordValid), true);
|
|
223
282
|
assert.deepEqual(result, {
|
|
224
|
-
message: ['Field 036
|
|
283
|
+
message: ['Field 036 requires ending punctuation, ends in \'e\''],
|
|
225
284
|
fix: ['Field 036 - Added punctuation to $b'],
|
|
226
285
|
valid: false
|
|
227
286
|
});
|
|
@@ -232,7 +291,7 @@ describe('ending-punctuation', () => {
|
|
|
232
291
|
const result = await validator.fix(recordInvalidOnlyA);
|
|
233
292
|
assert.equal(recordInvalidOnlyA.equalsTo(recordValidOnlyA), true);
|
|
234
293
|
assert.deepEqual(result, {
|
|
235
|
-
message: ['Field 036 has
|
|
294
|
+
message: ['Field 036 has unwanted ending punctuation \'.\''],
|
|
236
295
|
fix: ['Field 036 - Removed punctuation from $a'],
|
|
237
296
|
valid: false
|
|
238
297
|
});
|
|
@@ -385,7 +444,7 @@ describe('ending-punctuation', () => {
|
|
|
385
444
|
const validator = await validatorFactory();
|
|
386
445
|
const result = await validator.validate(recordInvalidOnlyAMissingA);
|
|
387
446
|
assert.deepEqual(result, {
|
|
388
|
-
message: ['Field 242
|
|
447
|
+
message: ['Field 242 requires ending punctuation, ends in \'t\''],
|
|
389
448
|
valid: false
|
|
390
449
|
});
|
|
391
450
|
});
|
|
@@ -394,7 +453,7 @@ describe('ending-punctuation', () => {
|
|
|
394
453
|
const validator = await validatorFactory();
|
|
395
454
|
const result = await validator.validate(recordInvalidOnlyAPuncY);
|
|
396
455
|
assert.deepEqual(result, {
|
|
397
|
-
message: ['Field 242 has
|
|
456
|
+
message: ['Field 242 has unwanted ending punctuation \'.\''],
|
|
398
457
|
valid: false
|
|
399
458
|
});
|
|
400
459
|
});
|
|
@@ -403,7 +462,7 @@ describe('ending-punctuation', () => {
|
|
|
403
462
|
const validator = await validatorFactory();
|
|
404
463
|
const result = await validator.validate(recordInvalidOnlyAMissingAPuncY);
|
|
405
464
|
assert.deepEqual(result, {
|
|
406
|
-
message: ['Field 242 has
|
|
465
|
+
message: ['Field 242 has unwanted ending punctuation \'.\'', 'Field 242 requires ending punctuation, ends in \'t\''],
|
|
407
466
|
valid: false
|
|
408
467
|
});
|
|
409
468
|
});
|
|
@@ -412,7 +471,7 @@ describe('ending-punctuation', () => {
|
|
|
412
471
|
const validator = await validatorFactory();
|
|
413
472
|
const result = await validator.validate(recordValidMultipleMissingP);
|
|
414
473
|
assert.deepEqual(result, {
|
|
415
|
-
message: ['Field 242
|
|
474
|
+
message: ['Field 242 requires ending punctuation, ends in \'y\''],
|
|
416
475
|
valid: false
|
|
417
476
|
});
|
|
418
477
|
});
|
|
@@ -421,7 +480,7 @@ describe('ending-punctuation', () => {
|
|
|
421
480
|
const validator = await validatorFactory();
|
|
422
481
|
const result = await validator.validate(recordValidWithoutYMissingA);
|
|
423
482
|
assert.deepEqual(result, {
|
|
424
|
-
message: ['Field 242
|
|
483
|
+
message: ['Field 242 requires ending punctuation, ends in \'t\''],
|
|
425
484
|
valid: false
|
|
426
485
|
});
|
|
427
486
|
});
|
|
@@ -432,7 +491,7 @@ describe('ending-punctuation', () => {
|
|
|
432
491
|
const result = await validator.fix(recordInvalidOnlyAMissingA);
|
|
433
492
|
assert.equal(recordInvalidOnlyAMissingA.equalsTo(recordValidOnlyA), true);
|
|
434
493
|
assert.deepEqual(result, {
|
|
435
|
-
message: ['Field 242
|
|
494
|
+
message: ['Field 242 requires ending punctuation, ends in \'t\''],
|
|
436
495
|
fix: ['Field 242 - Added punctuation to $a'],
|
|
437
496
|
valid: false
|
|
438
497
|
});
|
|
@@ -443,7 +502,7 @@ describe('ending-punctuation', () => {
|
|
|
443
502
|
const result = await validator.fix(recordInvalidOnlyAPuncY);
|
|
444
503
|
assert.equal(recordInvalidOnlyAPuncY.equalsTo(recordValidOnlyA), true);
|
|
445
504
|
assert.deepEqual(result, {
|
|
446
|
-
message: ['Field 242 has
|
|
505
|
+
message: ['Field 242 has unwanted ending punctuation \'.\''],
|
|
447
506
|
fix: ['Field 242 - Removed punctuation from $y'],
|
|
448
507
|
valid: false
|
|
449
508
|
});
|
|
@@ -454,7 +513,7 @@ describe('ending-punctuation', () => {
|
|
|
454
513
|
const result = await validator.fix(recordInvalidOnlyAMissingAPuncY);
|
|
455
514
|
assert.equal(recordInvalidOnlyAMissingAPuncY.equalsTo(recordValidOnlyA), true);
|
|
456
515
|
assert.deepEqual(result, {
|
|
457
|
-
message: ['Field 242 has
|
|
516
|
+
message: ['Field 242 has unwanted ending punctuation \'.\'', 'Field 242 requires ending punctuation, ends in \'t\''],
|
|
458
517
|
fix: ['Field 242 - Removed punctuation from $y', 'Field 242 - Added punctuation to $a'],
|
|
459
518
|
valid: false
|
|
460
519
|
});
|
|
@@ -465,7 +524,7 @@ describe('ending-punctuation', () => {
|
|
|
465
524
|
const result = await validator.fix(recordValidMultipleMissingP);
|
|
466
525
|
assert.equal(recordValidMultipleMissingP.equalsTo(recordValidMultiple), true);
|
|
467
526
|
assert.deepEqual(result, {
|
|
468
|
-
message: ['Field 242
|
|
527
|
+
message: ['Field 242 requires ending punctuation, ends in \'y\''],
|
|
469
528
|
fix: ['Field 242 - Added punctuation to $p'],
|
|
470
529
|
valid: false
|
|
471
530
|
});
|
|
@@ -476,7 +535,7 @@ describe('ending-punctuation', () => {
|
|
|
476
535
|
const result = await validator.fix(recordValidWithoutYMissingA);
|
|
477
536
|
assert.equal(recordValidWithoutYMissingA.equalsTo(recordValidWithoutY), true);
|
|
478
537
|
assert.deepEqual(result, {
|
|
479
|
-
message: ['Field 242
|
|
538
|
+
message: ['Field 242 requires ending punctuation, ends in \'t\''],
|
|
480
539
|
fix: ['Field 242 - Added punctuation to $a'],
|
|
481
540
|
valid: false
|
|
482
541
|
});
|
|
@@ -592,7 +651,7 @@ describe('ending-punctuation', () => {
|
|
|
592
651
|
const validator = await validatorFactory();
|
|
593
652
|
const result = await validator.validate(recordInvalidEndC);
|
|
594
653
|
assert.deepEqual(result, {
|
|
595
|
-
message: ['Field 260
|
|
654
|
+
message: ['Field 260 requires ending punctuation, ends in \'2\''],
|
|
596
655
|
valid: false
|
|
597
656
|
});
|
|
598
657
|
});
|
|
@@ -601,7 +660,7 @@ describe('ending-punctuation', () => {
|
|
|
601
660
|
const validator = await validatorFactory();
|
|
602
661
|
const result = await validator.validate(recordInvalidEndGDouble);
|
|
603
662
|
assert.deepEqual(result, {
|
|
604
|
-
message: ['Field 260 has
|
|
663
|
+
message: ['Field 260 has an extra dot after \')\''],
|
|
605
664
|
valid: false
|
|
606
665
|
});
|
|
607
666
|
});
|
|
@@ -612,7 +671,7 @@ describe('ending-punctuation', () => {
|
|
|
612
671
|
const result = await validator.fix(recordInvalidEndC);
|
|
613
672
|
assert.equal(recordInvalidEndC.equalsTo(recordValidEndC), true);
|
|
614
673
|
assert.deepEqual(result, {
|
|
615
|
-
message: ['Field 260
|
|
674
|
+
message: ['Field 260 requires ending punctuation, ends in \'2\''],
|
|
616
675
|
fix: ['Field 260 - Added punctuation to $c'],
|
|
617
676
|
valid: false
|
|
618
677
|
});
|
|
@@ -623,8 +682,8 @@ describe('ending-punctuation', () => {
|
|
|
623
682
|
const result = await validator.fix(recordInvalidEndGDouble);
|
|
624
683
|
assert.equal(recordInvalidEndGDouble.equalsTo(recordValidEndG), true);
|
|
625
684
|
assert.deepEqual(result, {
|
|
626
|
-
message: ['Field 260 has
|
|
627
|
-
fix: ['Field 260 - Removed
|
|
685
|
+
message: ['Field 260 has an extra dot after \')\''],
|
|
686
|
+
fix: ['Field 260 - Removed dot after punctuation from $g'],
|
|
628
687
|
valid: false
|
|
629
688
|
});
|
|
630
689
|
});
|
|
@@ -767,7 +826,7 @@ describe('ending-punctuation', () => {
|
|
|
767
826
|
const validator = await validatorFactory();
|
|
768
827
|
const result = await validator.validate(recordInvalidInd2v1);
|
|
769
828
|
assert.deepEqual(result, {
|
|
770
|
-
message: ['Field 264
|
|
829
|
+
message: ['Field 264 requires ending punctuation, ends in \'6\''],
|
|
771
830
|
valid: false
|
|
772
831
|
});
|
|
773
832
|
});
|
|
@@ -776,7 +835,7 @@ describe('ending-punctuation', () => {
|
|
|
776
835
|
const validator = await validatorFactory();
|
|
777
836
|
const result = await validator.validate(recordInvalidCopyrightCExtra);
|
|
778
837
|
assert.deepEqual(result, {
|
|
779
|
-
message: ['Field 264 has
|
|
838
|
+
message: ['Field 264 has unwanted ending punctuation \'.\''],
|
|
780
839
|
valid: false
|
|
781
840
|
});
|
|
782
841
|
});
|
|
@@ -787,7 +846,7 @@ describe('ending-punctuation', () => {
|
|
|
787
846
|
const result = await validator.fix(recordInvalidInd2v1);
|
|
788
847
|
assert.equal(recordInvalidInd2v1.equalsTo(recordValidInd2v1), true);
|
|
789
848
|
assert.deepEqual(result, {
|
|
790
|
-
message: ['Field 264
|
|
849
|
+
message: ['Field 264 requires ending punctuation, ends in \'6\''],
|
|
791
850
|
fix: ['Field 264 - Added punctuation to $c'],
|
|
792
851
|
valid: false
|
|
793
852
|
});
|
|
@@ -798,7 +857,7 @@ describe('ending-punctuation', () => {
|
|
|
798
857
|
const result = await validator.fix(recordInvalidCopyrightCExtra);
|
|
799
858
|
assert.equal(recordInvalidCopyrightCExtra.equalsTo(recordValidCopyright), true);
|
|
800
859
|
assert.deepEqual(result, {
|
|
801
|
-
message: ['Field 264 has
|
|
860
|
+
message: ['Field 264 has unwanted ending punctuation \'.\''],
|
|
802
861
|
fix: ['Field 264 - Removed punctuation from $c'],
|
|
803
862
|
valid: false
|
|
804
863
|
});
|
|
@@ -998,7 +1057,7 @@ describe('ending-punctuation', () => {
|
|
|
998
1057
|
const validator = await validatorFactory();
|
|
999
1058
|
const result = await validator.validate(recordInvalidA);
|
|
1000
1059
|
assert.deepEqual(result, {
|
|
1001
|
-
message: ['Field 340
|
|
1060
|
+
message: ['Field 340 requires ending punctuation, ends in \'e\''],
|
|
1002
1061
|
valid: false
|
|
1003
1062
|
});
|
|
1004
1063
|
});
|
|
@@ -1007,7 +1066,7 @@ describe('ending-punctuation', () => {
|
|
|
1007
1066
|
const validator = await validatorFactory();
|
|
1008
1067
|
const result = await validator.validate(recordInvalidAMissingB);
|
|
1009
1068
|
assert.deepEqual(result, {
|
|
1010
|
-
message: ['Field 340
|
|
1069
|
+
message: ['Field 340 requires ending punctuation, ends in \'t\''],
|
|
1011
1070
|
valid: false
|
|
1012
1071
|
});
|
|
1013
1072
|
});
|
|
@@ -1016,7 +1075,7 @@ describe('ending-punctuation', () => {
|
|
|
1016
1075
|
const validator = await validatorFactory();
|
|
1017
1076
|
const result = await validator.validate(recordInvalidABMissing);
|
|
1018
1077
|
assert.deepEqual(result, {
|
|
1019
|
-
message: ['Field 340
|
|
1078
|
+
message: ['Field 340 requires ending punctuation, ends in \'m\''],
|
|
1020
1079
|
valid: false
|
|
1021
1080
|
});
|
|
1022
1081
|
});
|
|
@@ -1025,7 +1084,7 @@ describe('ending-punctuation', () => {
|
|
|
1025
1084
|
const validator = await validatorFactory();
|
|
1026
1085
|
const result = await validator.validate(recordInvalidDDMissing);
|
|
1027
1086
|
assert.deepEqual(result, {
|
|
1028
|
-
message: ['Field 340
|
|
1087
|
+
message: ['Field 340 requires ending punctuation, ends in \'d\''],
|
|
1029
1088
|
valid: false
|
|
1030
1089
|
});
|
|
1031
1090
|
});
|
|
@@ -1034,7 +1093,7 @@ describe('ending-punctuation', () => {
|
|
|
1034
1093
|
const validator = await validatorFactory();
|
|
1035
1094
|
const result = await validator.validate(recordInvalidComplexDMissing);
|
|
1036
1095
|
assert.deepEqual(result, {
|
|
1037
|
-
message: ['Field 340
|
|
1096
|
+
message: ['Field 340 requires ending punctuation, ends in \'e\''],
|
|
1038
1097
|
valid: false
|
|
1039
1098
|
});
|
|
1040
1099
|
});
|
|
@@ -1045,7 +1104,7 @@ describe('ending-punctuation', () => {
|
|
|
1045
1104
|
const result = await validator.fix(recordInvalidA);
|
|
1046
1105
|
assert.equal(recordInvalidA.equalsTo(recordInvalidA), true);
|
|
1047
1106
|
assert.deepEqual(result, {
|
|
1048
|
-
message: ['Field 340
|
|
1107
|
+
message: ['Field 340 requires ending punctuation, ends in \'e\''],
|
|
1049
1108
|
fix: ['Field 340 - Added punctuation to $a'],
|
|
1050
1109
|
valid: false
|
|
1051
1110
|
});
|
|
@@ -1056,7 +1115,7 @@ describe('ending-punctuation', () => {
|
|
|
1056
1115
|
const result = await validator.fix(recordInvalidAMissingB);
|
|
1057
1116
|
assert.equal(recordInvalidAMissingB.equalsTo(recordValidAB), true);
|
|
1058
1117
|
assert.deepEqual(result, {
|
|
1059
|
-
message: ['Field 340
|
|
1118
|
+
message: ['Field 340 requires ending punctuation, ends in \'t\''],
|
|
1060
1119
|
fix: ['Field 340 - Added punctuation to $a'],
|
|
1061
1120
|
valid: false
|
|
1062
1121
|
});
|
|
@@ -1067,7 +1126,7 @@ describe('ending-punctuation', () => {
|
|
|
1067
1126
|
const result = await validator.fix(recordInvalidABMissing);
|
|
1068
1127
|
assert.equal(recordInvalidABMissing.equalsTo(recordValidAB), true);
|
|
1069
1128
|
assert.deepEqual(result, {
|
|
1070
|
-
message: ['Field 340
|
|
1129
|
+
message: ['Field 340 requires ending punctuation, ends in \'m\''],
|
|
1071
1130
|
fix: ['Field 340 - Added punctuation to $b'],
|
|
1072
1131
|
valid: false
|
|
1073
1132
|
});
|
|
@@ -1078,7 +1137,7 @@ describe('ending-punctuation', () => {
|
|
|
1078
1137
|
const result = await validator.fix(recordInvalidDDMissing);
|
|
1079
1138
|
assert.equal(recordInvalidDDMissing.equalsTo(recordValidDD), true);
|
|
1080
1139
|
assert.deepEqual(result, {
|
|
1081
|
-
message: ['Field 340
|
|
1140
|
+
message: ['Field 340 requires ending punctuation, ends in \'d\''],
|
|
1082
1141
|
fix: ['Field 340 - Added punctuation to $d'],
|
|
1083
1142
|
valid: false
|
|
1084
1143
|
});
|
|
@@ -1089,7 +1148,7 @@ describe('ending-punctuation', () => {
|
|
|
1089
1148
|
const result = await validator.fix(recordInvalidComplexDMissing);
|
|
1090
1149
|
assert.equal(recordInvalidComplexDMissing.equalsTo(recordInvalidComplexDMissing), true);
|
|
1091
1150
|
assert.deepEqual(result, {
|
|
1092
|
-
message: ['Field 340
|
|
1151
|
+
message: ['Field 340 requires ending punctuation, ends in \'e\''],
|
|
1093
1152
|
fix: ['Field 340 - Added punctuation to $d'],
|
|
1094
1153
|
valid: false
|
|
1095
1154
|
});
|
|
@@ -1191,7 +1250,7 @@ describe('ending-punctuation', () => {
|
|
|
1191
1250
|
const validator = await validatorFactory();
|
|
1192
1251
|
const result = await validator.validate(recordInvalid);
|
|
1193
1252
|
assert.deepEqual(result, {
|
|
1194
|
-
message: ['Field 520
|
|
1253
|
+
message: ['Field 520 requires ending punctuation, ends in \'ö\''],
|
|
1195
1254
|
valid: false
|
|
1196
1255
|
});
|
|
1197
1256
|
});
|
|
@@ -1200,7 +1259,7 @@ describe('ending-punctuation', () => {
|
|
|
1200
1259
|
const validator = await validatorFactory();
|
|
1201
1260
|
const result = await validator.validate(recordInvalidWithU);
|
|
1202
1261
|
assert.deepEqual(result, {
|
|
1203
|
-
message: ['Field 520
|
|
1262
|
+
message: ['Field 520 requires ending punctuation, ends in \'i\''],
|
|
1204
1263
|
valid: false
|
|
1205
1264
|
});
|
|
1206
1265
|
});
|
|
@@ -1211,7 +1270,7 @@ describe('ending-punctuation', () => {
|
|
|
1211
1270
|
const result = await validator.fix(recordInvalid);
|
|
1212
1271
|
assert.equal(recordInvalid.equalsTo(recordValid), true);
|
|
1213
1272
|
assert.deepEqual(result, {
|
|
1214
|
-
message: ['Field 520
|
|
1273
|
+
message: ['Field 520 requires ending punctuation, ends in \'ö\''],
|
|
1215
1274
|
fix: ['Field 520 - Added punctuation to $a'],
|
|
1216
1275
|
valid: false
|
|
1217
1276
|
});
|
|
@@ -1222,7 +1281,7 @@ describe('ending-punctuation', () => {
|
|
|
1222
1281
|
const result = await validator.fix(recordInvalidWithU);
|
|
1223
1282
|
assert.equal(recordInvalidWithU.equalsTo(recordValidWithU), true);
|
|
1224
1283
|
assert.deepEqual(result, {
|
|
1225
|
-
message: ['Field 520
|
|
1284
|
+
message: ['Field 520 requires ending punctuation, ends in \'i\''],
|
|
1226
1285
|
fix: ['Field 520 - Added punctuation to $a'],
|
|
1227
1286
|
valid: false
|
|
1228
1287
|
});
|
|
@@ -1345,7 +1404,7 @@ describe('ending-punctuation', () => {
|
|
|
1345
1404
|
const validator = await validatorFactory();
|
|
1346
1405
|
const result = await validator.validate(recordInvalidMissingI);
|
|
1347
1406
|
assert.deepEqual(result, {
|
|
1348
|
-
message: ['Field 538
|
|
1407
|
+
message: ['Field 538 requires ending punctuation, ends in \'s\''],
|
|
1349
1408
|
valid: false
|
|
1350
1409
|
});
|
|
1351
1410
|
});
|
|
@@ -1354,7 +1413,7 @@ describe('ending-punctuation', () => {
|
|
|
1354
1413
|
const validator = await validatorFactory();
|
|
1355
1414
|
const result = await validator.validate(recordInvalidI);
|
|
1356
1415
|
assert.deepEqual(result, {
|
|
1357
|
-
message: ['Field 538
|
|
1416
|
+
message: ['Field 538 requires ending punctuation, ends in \':\''],
|
|
1358
1417
|
valid: false
|
|
1359
1418
|
});
|
|
1360
1419
|
});
|
|
@@ -1363,7 +1422,7 @@ describe('ending-punctuation', () => {
|
|
|
1363
1422
|
const validator = await validatorFactory();
|
|
1364
1423
|
const result = await validator.validate(recordInvalidOnlyA);
|
|
1365
1424
|
assert.deepEqual(result, {
|
|
1366
|
-
message: ['Field 538
|
|
1425
|
+
message: ['Field 538 requires ending punctuation, ends in \'e\''],
|
|
1367
1426
|
valid: false
|
|
1368
1427
|
});
|
|
1369
1428
|
});
|
|
@@ -1374,7 +1433,7 @@ describe('ending-punctuation', () => {
|
|
|
1374
1433
|
const result = await validator.fix(recordInvalidMissingI);
|
|
1375
1434
|
assert.equal(recordInvalidMissingI.equalsTo(recordValid), true);
|
|
1376
1435
|
assert.deepEqual(result, {
|
|
1377
|
-
message: ['Field 538
|
|
1436
|
+
message: ['Field 538 requires ending punctuation, ends in \'s\''],
|
|
1378
1437
|
fix: ['Field 538 - Added punctuation to $i'],
|
|
1379
1438
|
valid: false
|
|
1380
1439
|
});
|
|
@@ -1385,7 +1444,7 @@ describe('ending-punctuation', () => {
|
|
|
1385
1444
|
const result = await validator.fix(recordInvalidOnlyA);
|
|
1386
1445
|
assert.equal(recordInvalidOnlyA.equalsTo(recordValidOnlyA), true);
|
|
1387
1446
|
assert.deepEqual(result, {
|
|
1388
|
-
message: ['Field 538
|
|
1447
|
+
message: ['Field 538 requires ending punctuation, ends in \'e\''],
|
|
1389
1448
|
fix: ['Field 538 - Added punctuation to $a'],
|
|
1390
1449
|
valid: false
|
|
1391
1450
|
});
|
|
@@ -1467,7 +1526,7 @@ describe('ending-punctuation', () => {
|
|
|
1467
1526
|
const validator = await validatorFactory();
|
|
1468
1527
|
const result = await validator.validate(recordInvalid);
|
|
1469
1528
|
assert.deepEqual(result, {
|
|
1470
|
-
message: ['Field 567
|
|
1529
|
+
message: ['Field 567 requires ending punctuation, ends in \'s\''],
|
|
1471
1530
|
valid: false
|
|
1472
1531
|
});
|
|
1473
1532
|
});
|
|
@@ -1476,7 +1535,7 @@ describe('ending-punctuation', () => {
|
|
|
1476
1535
|
const validator = await validatorFactory();
|
|
1477
1536
|
const result = await validator.validate(recordInvalidWithoutA);
|
|
1478
1537
|
assert.deepEqual(result, {
|
|
1479
|
-
message: ['Field 567 has
|
|
1538
|
+
message: ['Field 567 has unwanted ending punctuation \'.\''],
|
|
1480
1539
|
valid: false
|
|
1481
1540
|
});
|
|
1482
1541
|
});
|
|
@@ -1487,7 +1546,7 @@ describe('ending-punctuation', () => {
|
|
|
1487
1546
|
const result = await validator.fix(recordInvalid);
|
|
1488
1547
|
assert.equal(recordInvalid.equalsTo(recordValid), true);
|
|
1489
1548
|
assert.deepEqual(result, {
|
|
1490
|
-
message: ['Field 567
|
|
1549
|
+
message: ['Field 567 requires ending punctuation, ends in \'s\''],
|
|
1491
1550
|
fix: ['Field 567 - Added punctuation to $a'],
|
|
1492
1551
|
valid: false
|
|
1493
1552
|
});
|
|
@@ -1498,7 +1557,7 @@ describe('ending-punctuation', () => {
|
|
|
1498
1557
|
const result = await validator.fix(recordInvalidWithoutA);
|
|
1499
1558
|
assert.equal(recordInvalidWithoutA.equalsTo(recordValidWithoutA), true);
|
|
1500
1559
|
assert.deepEqual(result, {
|
|
1501
|
-
message: ['Field 567 has
|
|
1560
|
+
message: ['Field 567 has unwanted ending punctuation \'.\''],
|
|
1502
1561
|
fix: ['Field 567 - Removed punctuation from $b'],
|
|
1503
1562
|
valid: false
|
|
1504
1563
|
});
|
|
@@ -1733,7 +1792,7 @@ describe('ending-punctuation', () => {
|
|
|
1733
1792
|
const validator = await validatorFactory();
|
|
1734
1793
|
const result = await validator.validate(recordInvalid647FastEndPunc);
|
|
1735
1794
|
assert.deepEqual(result, {
|
|
1736
|
-
message: ['Field 647 has
|
|
1795
|
+
message: ['Field 647 has an extra dot after \')\''],
|
|
1737
1796
|
valid: false
|
|
1738
1797
|
});
|
|
1739
1798
|
});
|
|
@@ -1742,7 +1801,7 @@ describe('ending-punctuation', () => {
|
|
|
1742
1801
|
const validator = await validatorFactory();
|
|
1743
1802
|
const result = await validator.validate(recordInvali648dFinYes);
|
|
1744
1803
|
assert.deepEqual(result, {
|
|
1745
|
-
message: ['Field 648 has
|
|
1804
|
+
message: ['Field 648 has unwanted ending punctuation \'.\''],
|
|
1746
1805
|
valid: false
|
|
1747
1806
|
});
|
|
1748
1807
|
});
|
|
@@ -1751,12 +1810,12 @@ describe('ending-punctuation', () => {
|
|
|
1751
1810
|
const validator = await validatorFactory();
|
|
1752
1811
|
const result = await validator.validate(recordInvalid648FastYes);
|
|
1753
1812
|
assert.deepEqual(result, {
|
|
1754
|
-
message: ['Field 648 has
|
|
1813
|
+
message: ['Field 648 has unwanted ending punctuation \'.\''],
|
|
1755
1814
|
valid: false
|
|
1756
1815
|
});
|
|
1757
1816
|
});
|
|
1758
1817
|
|
|
1759
|
-
const invalidField650Message = 'Field 650 has
|
|
1818
|
+
const invalidField650Message = 'Field 650 has unwanted ending punctuation \'.\'';
|
|
1760
1819
|
it('Finds record invalid - 650 Finnish, with punc', async () => {
|
|
1761
1820
|
const validator = await validatorFactory();
|
|
1762
1821
|
const result = await validator.validate(recordInvalid650FinYes);
|
|
@@ -1770,7 +1829,7 @@ describe('ending-punctuation', () => {
|
|
|
1770
1829
|
const validator = await validatorFactory();
|
|
1771
1830
|
const result = await validator.validate(recordInvalid650EngNoControl);
|
|
1772
1831
|
assert.deepEqual(result, {
|
|
1773
|
-
message: [
|
|
1832
|
+
message: ['Field 650 requires ending punctuation, ends in \'s\''],
|
|
1774
1833
|
valid: false
|
|
1775
1834
|
});
|
|
1776
1835
|
});
|
|
@@ -1779,7 +1838,7 @@ describe('ending-punctuation', () => {
|
|
|
1779
1838
|
const validator = await validatorFactory();
|
|
1780
1839
|
const result = await validator.validate(recordInvalid650EngControl);
|
|
1781
1840
|
assert.deepEqual(result, {
|
|
1782
|
-
message: ['Field 650
|
|
1841
|
+
message: ['Field 650 requires ending punctuation, ends in \'n\''],
|
|
1783
1842
|
valid: false
|
|
1784
1843
|
});
|
|
1785
1844
|
});
|
|
@@ -1790,8 +1849,8 @@ describe('ending-punctuation', () => {
|
|
|
1790
1849
|
const result = await validator.fix(recordInvalid647FastEndPunc);
|
|
1791
1850
|
assert.equal(recordInvalid647FastEndPunc.equalsTo(recordValid647FastEndPunc), true);
|
|
1792
1851
|
assert.deepEqual(result, {
|
|
1793
|
-
message: ['Field 647 has
|
|
1794
|
-
fix: ['Field 647 - Removed
|
|
1852
|
+
message: ['Field 647 has an extra dot after \')\''],
|
|
1853
|
+
fix: ['Field 647 - Removed dot after punctuation from $d'],
|
|
1795
1854
|
valid: false
|
|
1796
1855
|
});
|
|
1797
1856
|
});
|
|
@@ -1801,7 +1860,7 @@ describe('ending-punctuation', () => {
|
|
|
1801
1860
|
const result = await validator.fix(recordInvali648dFinYes);
|
|
1802
1861
|
assert.equal(recordInvali648dFinYes.equalsTo(recordVali648dFinNo), true);
|
|
1803
1862
|
assert.deepEqual(result, {
|
|
1804
|
-
message: ['Field 648 has
|
|
1863
|
+
message: ['Field 648 has unwanted ending punctuation \'.\''],
|
|
1805
1864
|
fix: ['Field 648 - Removed punctuation from $a'],
|
|
1806
1865
|
valid: false
|
|
1807
1866
|
});
|
|
@@ -1812,7 +1871,7 @@ describe('ending-punctuation', () => {
|
|
|
1812
1871
|
const result = await validator.fix(recordInvalid648FastYes);
|
|
1813
1872
|
assert.equal(recordInvalid648FastYes.equalsTo(recordValid648FastNo), true);
|
|
1814
1873
|
assert.deepEqual(result, {
|
|
1815
|
-
message: ['Field 648 has
|
|
1874
|
+
message: ['Field 648 has unwanted ending punctuation \'.\''],
|
|
1816
1875
|
fix: ['Field 648 - Removed punctuation from $a'],
|
|
1817
1876
|
valid: false
|
|
1818
1877
|
});
|
|
@@ -1834,7 +1893,7 @@ describe('ending-punctuation', () => {
|
|
|
1834
1893
|
const result = await validator.fix(recordInvalid650EngNoControl);
|
|
1835
1894
|
assert.equal(recordInvalid650EngNoControl.equalsTo(recordValid650EngNoControl), true);
|
|
1836
1895
|
assert.deepEqual(result, {
|
|
1837
|
-
message: ['Field 650
|
|
1896
|
+
message: ['Field 650 requires ending punctuation, ends in \'s\''],
|
|
1838
1897
|
fix: ['Field 650 - Added punctuation to $v'],
|
|
1839
1898
|
valid: false
|
|
1840
1899
|
});
|
|
@@ -1845,7 +1904,7 @@ describe('ending-punctuation', () => {
|
|
|
1845
1904
|
const result = await validator.fix(recordInvalid650EngControl);
|
|
1846
1905
|
assert.equal(recordInvalid650EngControl.equalsTo(recordValid650EngControl), true);
|
|
1847
1906
|
assert.deepEqual(result, {
|
|
1848
|
-
message: ['Field 650
|
|
1907
|
+
message: ['Field 650 requires ending punctuation, ends in \'n\''],
|
|
1849
1908
|
fix: ['Field 650 - Added punctuation to $a'],
|
|
1850
1909
|
valid: false
|
|
1851
1910
|
});
|
|
@@ -1855,7 +1914,7 @@ describe('ending-punctuation', () => {
|
|
|
1855
1914
|
// "654-662 EI - EI suomalaisten sanastojen termeihin, muihin sanaston käytännön mukaan, yleensä KYLLÄ"
|
|
1856
1915
|
// Finnish terms at $2:['ysa', 'yso', 'kassu', 'seko', 'valo', 'kulo', 'puho', 'oiko', 'mero', 'liito', 'fast', 'allars']
|
|
1857
1916
|
// Default TRUE, until more special cases are added
|
|
1858
|
-
describe('#654-662 TRUE - If
|
|
1917
|
+
describe('#654-662 TRUE - If Finnish, else TRUE', () => {
|
|
1859
1918
|
// Valid tests
|
|
1860
1919
|
const recordValid655FinNo = new MarcRecord({
|
|
1861
1920
|
leader: '',
|
|
@@ -2152,7 +2211,7 @@ describe('ending-punctuation', () => {
|
|
|
2152
2211
|
const validator = await validatorFactory();
|
|
2153
2212
|
const result = await validator.validate(recordInvalid655FinYes);
|
|
2154
2213
|
assert.deepEqual(result, {
|
|
2155
|
-
message: ['Field 655 has
|
|
2214
|
+
message: ['Field 655 has unwanted ending punctuation \'.\''],
|
|
2156
2215
|
valid: false
|
|
2157
2216
|
});
|
|
2158
2217
|
});
|
|
@@ -2161,7 +2220,7 @@ describe('ending-punctuation', () => {
|
|
|
2161
2220
|
const validator = await validatorFactory();
|
|
2162
2221
|
const result = await validator.validate(recordInvalid655FinYes2);
|
|
2163
2222
|
assert.deepEqual(result, {
|
|
2164
|
-
message: ['Field 655 has
|
|
2223
|
+
message: ['Field 655 has unwanted ending punctuation \'.\''],
|
|
2165
2224
|
valid: false
|
|
2166
2225
|
});
|
|
2167
2226
|
});
|
|
@@ -2170,7 +2229,7 @@ describe('ending-punctuation', () => {
|
|
|
2170
2229
|
const validator = await validatorFactory();
|
|
2171
2230
|
const result = await validator.validate(recordInvalid655EngNo);
|
|
2172
2231
|
assert.deepEqual(result, {
|
|
2173
|
-
message: ['Field 655
|
|
2232
|
+
message: ['Field 655 requires ending punctuation, ends in \'4\''],
|
|
2174
2233
|
valid: false
|
|
2175
2234
|
});
|
|
2176
2235
|
});
|
|
@@ -2179,7 +2238,7 @@ describe('ending-punctuation', () => {
|
|
|
2179
2238
|
const validator = await validatorFactory();
|
|
2180
2239
|
const result = await validator.validate(recordInvalid655EngNoNoControl);
|
|
2181
2240
|
assert.deepEqual(result, {
|
|
2182
|
-
message: ['Field 655
|
|
2241
|
+
message: ['Field 655 requires ending punctuation, ends in \'s\''],
|
|
2183
2242
|
valid: false
|
|
2184
2243
|
});
|
|
2185
2244
|
});
|
|
@@ -2188,7 +2247,7 @@ describe('ending-punctuation', () => {
|
|
|
2188
2247
|
const validator = await validatorFactory();
|
|
2189
2248
|
const result = await validator.validate(recordInvalid656FinYes);
|
|
2190
2249
|
assert.deepEqual(result, {
|
|
2191
|
-
message: ['Field 656 has
|
|
2250
|
+
message: ['Field 656 has unwanted ending punctuation \'.\''],
|
|
2192
2251
|
valid: false
|
|
2193
2252
|
});
|
|
2194
2253
|
});
|
|
@@ -2197,7 +2256,7 @@ describe('ending-punctuation', () => {
|
|
|
2197
2256
|
const validator = await validatorFactory();
|
|
2198
2257
|
const result = await validator.validate(recordInvalid657EngNo);
|
|
2199
2258
|
assert.deepEqual(result, {
|
|
2200
|
-
message: ['Field 657
|
|
2259
|
+
message: ['Field 657 requires ending punctuation, ends in \'k\''],
|
|
2201
2260
|
valid: false
|
|
2202
2261
|
});
|
|
2203
2262
|
});
|
|
@@ -2206,7 +2265,7 @@ describe('ending-punctuation', () => {
|
|
|
2206
2265
|
const validator = await validatorFactory();
|
|
2207
2266
|
const result = await validator.validate(recordInvalid658EngNo);
|
|
2208
2267
|
assert.deepEqual(result, {
|
|
2209
|
-
message: ['Field 658
|
|
2268
|
+
message: ['Field 658 requires ending punctuation, ends in \'d\''],
|
|
2210
2269
|
valid: false
|
|
2211
2270
|
});
|
|
2212
2271
|
});
|
|
@@ -2215,7 +2274,7 @@ describe('ending-punctuation', () => {
|
|
|
2215
2274
|
const validator = await validatorFactory();
|
|
2216
2275
|
const result = await validator.validate(recordInvalid662EngNo);
|
|
2217
2276
|
assert.deepEqual(result, {
|
|
2218
|
-
message: ['Field 662
|
|
2277
|
+
message: ['Field 662 requires ending punctuation, ends in \'a\''],
|
|
2219
2278
|
valid: false
|
|
2220
2279
|
});
|
|
2221
2280
|
});
|
|
@@ -2226,7 +2285,7 @@ describe('ending-punctuation', () => {
|
|
|
2226
2285
|
const result = await validator.fix(recordInvalid655FinYes);
|
|
2227
2286
|
assert.equal(recordInvalid655FinYes.equalsTo(recordValid655FinNo), true);
|
|
2228
2287
|
assert.deepEqual(result, {
|
|
2229
|
-
message: ['Field 655 has
|
|
2288
|
+
message: ['Field 655 has unwanted ending punctuation \'.\''],
|
|
2230
2289
|
fix: ['Field 655 - Removed punctuation from $a'],
|
|
2231
2290
|
valid: false
|
|
2232
2291
|
});
|
|
@@ -2237,7 +2296,7 @@ describe('ending-punctuation', () => {
|
|
|
2237
2296
|
const result = await validator.fix(recordInvalid655FinYes2);
|
|
2238
2297
|
assert.equal(recordInvalid655FinYes2.equalsTo(recordValid655FinNo2), true);
|
|
2239
2298
|
assert.deepEqual(result, {
|
|
2240
|
-
message: ['Field 655 has
|
|
2299
|
+
message: ['Field 655 has unwanted ending punctuation \'.\''],
|
|
2241
2300
|
fix: ['Field 655 - Removed punctuation from $a'],
|
|
2242
2301
|
valid: false
|
|
2243
2302
|
});
|
|
@@ -2248,7 +2307,7 @@ describe('ending-punctuation', () => {
|
|
|
2248
2307
|
const result = await validator.fix(recordInvalid655EngNo);
|
|
2249
2308
|
assert.equal(recordInvalid655EngNo.equalsTo(recordValid655EngYes), true);
|
|
2250
2309
|
assert.deepEqual(result, {
|
|
2251
|
-
message: ['Field 655
|
|
2310
|
+
message: ['Field 655 requires ending punctuation, ends in \'4\''],
|
|
2252
2311
|
fix: ['Field 655 - Added punctuation to $y'],
|
|
2253
2312
|
valid: false
|
|
2254
2313
|
});
|
|
@@ -2259,7 +2318,7 @@ describe('ending-punctuation', () => {
|
|
|
2259
2318
|
const result = await validator.fix(recordInvalid655EngNoNoControl);
|
|
2260
2319
|
assert.equal(recordInvalid655EngNoNoControl.equalsTo(recordValid655EngYesNoControl), true);
|
|
2261
2320
|
assert.deepEqual(result, {
|
|
2262
|
-
message: ['Field 655
|
|
2321
|
+
message: ['Field 655 requires ending punctuation, ends in \'s\''],
|
|
2263
2322
|
fix: ['Field 655 - Added punctuation to $a'],
|
|
2264
2323
|
valid: false
|
|
2265
2324
|
});
|
|
@@ -2270,7 +2329,7 @@ describe('ending-punctuation', () => {
|
|
|
2270
2329
|
const result = await validator.fix(recordInvalid656FinYes);
|
|
2271
2330
|
assert.equal(recordInvalid656FinYes.equalsTo(recordValid656FinNo), true);
|
|
2272
2331
|
assert.deepEqual(result, {
|
|
2273
|
-
message: ['Field 656 has
|
|
2332
|
+
message: ['Field 656 has unwanted ending punctuation \'.\''],
|
|
2274
2333
|
fix: ['Field 656 - Removed punctuation from $a'],
|
|
2275
2334
|
valid: false
|
|
2276
2335
|
});
|
|
@@ -2281,7 +2340,7 @@ describe('ending-punctuation', () => {
|
|
|
2281
2340
|
const result = await validator.fix(recordInvalid657EngNo);
|
|
2282
2341
|
assert.equal(recordInvalid657EngNo.equalsTo(recordValid657EngYes), true);
|
|
2283
2342
|
assert.deepEqual(result, {
|
|
2284
|
-
message: ['Field 657
|
|
2343
|
+
message: ['Field 657 requires ending punctuation, ends in \'k\''],
|
|
2285
2344
|
fix: ['Field 657 - Added punctuation to $z'],
|
|
2286
2345
|
valid: false
|
|
2287
2346
|
});
|
|
@@ -2292,18 +2351,18 @@ describe('ending-punctuation', () => {
|
|
|
2292
2351
|
const result = await validator.fix(recordInvalid658EngNo);
|
|
2293
2352
|
assert.equal(recordInvalid658EngNo.equalsTo(recordValid658EngYes), true);
|
|
2294
2353
|
assert.deepEqual(result, {
|
|
2295
|
-
message: ['Field 658
|
|
2354
|
+
message: ['Field 658 requires ending punctuation, ends in \'d\''],
|
|
2296
2355
|
fix: ['Field 658 - Added punctuation to $d'],
|
|
2297
2356
|
valid: false
|
|
2298
2357
|
});
|
|
2299
2358
|
});
|
|
2300
2359
|
|
|
2301
|
-
it('Repairs the invalid record - 662 !Finnish, add
|
|
2360
|
+
it('Repairs the invalid record - 662 !Finnish, add punc $a', async () => {
|
|
2302
2361
|
const validator = await validatorFactory();
|
|
2303
2362
|
const result = await validator.fix(recordInvalid662EngNo);
|
|
2304
2363
|
assert.equal(recordInvalid662EngNo.equalsTo(recordValid662EngYes), true);
|
|
2305
2364
|
assert.deepEqual(result, {
|
|
2306
|
-
message: ['Field 662
|
|
2365
|
+
message: ['Field 662 requires ending punctuation, ends in \'a\''],
|
|
2307
2366
|
fix: ['Field 662 - Added punctuation to $a'],
|
|
2308
2367
|
valid: false
|
|
2309
2368
|
});
|
|
@@ -2387,7 +2446,7 @@ describe('ending-punctuation', () => {
|
|
|
2387
2446
|
const validator = await validatorFactory();
|
|
2388
2447
|
const result = await validator.validate(recordInvalid);
|
|
2389
2448
|
assert.deepEqual(result, {
|
|
2390
|
-
message: ['Field 760 has
|
|
2449
|
+
message: ['Field 760 has unwanted ending punctuation \'.\''],
|
|
2391
2450
|
valid: false
|
|
2392
2451
|
});
|
|
2393
2452
|
});
|
|
@@ -2396,7 +2455,7 @@ describe('ending-punctuation', () => {
|
|
|
2396
2455
|
const validator = await validatorFactory();
|
|
2397
2456
|
const result = await validator.validate(recordInvalidOnlyA);
|
|
2398
2457
|
assert.deepEqual(result, {
|
|
2399
|
-
message: ['Field 760
|
|
2458
|
+
message: ['Field 760 requires ending punctuation, ends in \'c\''],
|
|
2400
2459
|
valid: false
|
|
2401
2460
|
});
|
|
2402
2461
|
});
|
|
@@ -2407,7 +2466,7 @@ describe('ending-punctuation', () => {
|
|
|
2407
2466
|
const result = await validator.fix(recordInvalid);
|
|
2408
2467
|
assert.equal(recordInvalid.equalsTo(recordValid), true);
|
|
2409
2468
|
assert.deepEqual(result, {
|
|
2410
|
-
message: ['Field 760 has
|
|
2469
|
+
message: ['Field 760 has unwanted ending punctuation \'.\''],
|
|
2411
2470
|
fix: ['Field 760 - Removed punctuation from $e'],
|
|
2412
2471
|
valid: false
|
|
2413
2472
|
});
|
|
@@ -2418,7 +2477,7 @@ describe('ending-punctuation', () => {
|
|
|
2418
2477
|
const result = await validator.fix(recordInvalidOnlyA);
|
|
2419
2478
|
assert.equal(recordInvalidOnlyA.equalsTo(recordValidOnlyA), true);
|
|
2420
2479
|
assert.deepEqual(result, {
|
|
2421
|
-
message: ['Field 760
|
|
2480
|
+
message: ['Field 760 requires ending punctuation, ends in \'c\''],
|
|
2422
2481
|
fix: ['Field 760 - Added punctuation to $a'],
|
|
2423
2482
|
valid: false
|
|
2424
2483
|
});
|
|
@@ -2513,7 +2572,7 @@ describe('ending-punctuation', () => {
|
|
|
2513
2572
|
const validator = await validatorFactory();
|
|
2514
2573
|
const result = await validator.validate(recordInvalidSimple);
|
|
2515
2574
|
assert.deepEqual(result, {
|
|
2516
|
-
message: ['Field 880
|
|
2575
|
+
message: ['Field 880 requires ending punctuation, ends in \'3\''],
|
|
2517
2576
|
valid: false
|
|
2518
2577
|
});
|
|
2519
2578
|
});
|
|
@@ -2522,7 +2581,7 @@ describe('ending-punctuation', () => {
|
|
|
2522
2581
|
const validator = await validatorFactory();
|
|
2523
2582
|
const result = await validator.validate(recordInvalidComplex);
|
|
2524
2583
|
assert.deepEqual(result, {
|
|
2525
|
-
message: ['Field 880
|
|
2584
|
+
message: ['Field 880 requires ending punctuation, ends in \'6\''],
|
|
2526
2585
|
valid: false
|
|
2527
2586
|
});
|
|
2528
2587
|
});
|
|
@@ -2533,7 +2592,7 @@ describe('ending-punctuation', () => {
|
|
|
2533
2592
|
const result = await validator.fix(recordInvalidSimple);
|
|
2534
2593
|
assert.equal(recordInvalidSimple.equalsTo(recordValidSimple), true);
|
|
2535
2594
|
assert.deepEqual(result, {
|
|
2536
|
-
message: ['Field 880
|
|
2595
|
+
message: ['Field 880 requires ending punctuation, ends in \'3\''],
|
|
2537
2596
|
fix: ['Field 880 - Added punctuation to $b'],
|
|
2538
2597
|
valid: false
|
|
2539
2598
|
});
|
|
@@ -2544,7 +2603,7 @@ describe('ending-punctuation', () => {
|
|
|
2544
2603
|
const result = await validator.fix(recordInvalidComplex);
|
|
2545
2604
|
assert.equal(recordInvalidComplex.equalsTo(recordValidComplex), true);
|
|
2546
2605
|
assert.deepEqual(result, {
|
|
2547
|
-
message: ['Field 880
|
|
2606
|
+
message: ['Field 880 requires ending punctuation, ends in \'6\''],
|
|
2548
2607
|
fix: ['Field 880 - Added punctuation to $c'],
|
|
2549
2608
|
valid: false
|
|
2550
2609
|
});
|