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', () => {
1212 ` A 1 3'Opt' ` ,
1313 ` A COLOR(BLU) ` ,
1414 ` A 1 8'Name' ` ,
15- ` A COLOR(BLU) `
15+ ` A COLOR(BLU) ` ,
16+ ` A R GLOBAL ` ,
17+ ` A SLNO(04) ` ,
18+ ` A 1 3'---' ` ,
1619 ] ;
1720
1821 it ( 'getRangeForFormat' , ( ) => {
@@ -26,12 +29,17 @@ describe('DisplayFile tests', () => {
2629 range = dds . getRangeForFormat ( `FMT1` ) ;
2730 expect ( range ?. start ) . toBe ( 3 ) ;
2831 expect ( range ?. end ) . toBe ( 9 ) ;
29- expect ( true ) . toBe ( true ) ;
3032
3133 range = dds . getRangeForFormat ( `HEAD` ) ;
3234 expect ( range ?. start ) . toBe ( 1 ) ;
3335 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 ) ;
3543 } ) ;
3644
3745} ) ;
Original file line number Diff line number Diff line change 22export interface DdsLineRange { start : number , endHeader ?: number , end : number } ;
33export interface DdsUpdate { newLines : string [ ] , range ?: DdsLineRange } ;
44
5- const GLOBAL_RECORD_NAME = `GLOBAL ` ;
5+ const GLOBAL_RECORD_NAME = `_GLOBAL ` ;
66
77export class DisplayFile {
88 public formats : RecordInfo [ ] = [ ] ;
You can’t perform that action at this time.
0 commit comments