File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ describe('DisplayFile tests', () => {
12
12
` A 1 3'Opt' ` ,
13
13
` A COLOR(BLU) ` ,
14
14
` A 1 8'Name' ` ,
15
- ` A COLOR(BLU) `
15
+ ` A COLOR(BLU) ` ,
16
+ ` A R GLOBAL ` ,
17
+ ` A SLNO(04) ` ,
18
+ ` A 1 3'---' ` ,
16
19
] ;
17
20
18
21
it ( 'getRangeForFormat' , ( ) => {
@@ -26,12 +29,17 @@ describe('DisplayFile tests', () => {
26
29
range = dds . getRangeForFormat ( `FMT1` ) ;
27
30
expect ( range ?. start ) . toBe ( 3 ) ;
28
31
expect ( range ?. end ) . toBe ( 9 ) ;
29
- expect ( true ) . toBe ( true ) ;
30
32
31
33
range = dds . getRangeForFormat ( `HEAD` ) ;
32
34
expect ( range ?. start ) . toBe ( 1 ) ;
33
35
expect ( range ?. end ) . toBe ( 3 ) ;
34
- expect ( true ) . toBe ( true ) ;
36
+ } ) ;
37
+
38
+ it ( 'No duplicate RecordInfo' , ( ) => {
39
+ let dds = new DisplayFile ( ) ;
40
+ dds . parse ( dspf1 ) ;
41
+ let names = dds . formats . map ( rcd => rcd . name ) ;
42
+ expect ( new Set ( names ) . size ) . toBe ( names . length ) ;
35
43
} ) ;
36
44
37
45
} ) ;
Original file line number Diff line number Diff line change 2
2
export interface DdsLineRange { start : number , endHeader ?: number , end : number } ;
3
3
export interface DdsUpdate { newLines : string [ ] , range ?: DdsLineRange } ;
4
4
5
- const GLOBAL_RECORD_NAME = `GLOBAL ` ;
5
+ const GLOBAL_RECORD_NAME = `_GLOBAL ` ;
6
6
7
7
export class DisplayFile {
8
8
public formats : RecordInfo [ ] = [ ] ;
You can’t perform that action at this time.
0 commit comments