File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ describe('DisplayFile tests', () => {
1616 ` A R GLOBAL ` ,
1717 ` A SLNO(04) ` ,
1818 ` A 1 3'---' ` ,
19+ ` A R FORM1 ` ,
20+ ` A SLNO(06) ` ,
21+ ` A FLD0101 10A B 3 5 ` ,
22+ ` A 20 DSPATR(PR) ` ,
23+ ` A COLOR(YLW) ` ,
24+ ` A FLD0102 10 B 3 5 ` ,
1925 ] ;
2026
2127 it ( 'getRangeForFormat' , ( ) => {
@@ -35,6 +41,24 @@ describe('DisplayFile tests', () => {
3541 expect ( range ?. end ) . toBe ( 3 ) ;
3642 } ) ;
3743
44+ it ( 'getRangeForField' , ( ) => {
45+ let dds = new DisplayFile ( ) ;
46+ dds . parse ( dspf1 ) ;
47+
48+ let range : DdsLineRange | undefined ;
49+
50+ expect ( dds . getRangeForField ( `FORM1` , `UNKNOWN` ) ) . toBeUndefined ( ) ;
51+
52+ range = dds . getRangeForField ( `FORM1` , `FLD0101` ) ;
53+ expect ( range ?. start ) . toBe ( 14 ) ;
54+ expect ( range ?. end ) . toBe ( 16 ) ;
55+
56+ range = dds . getRangeForField ( `FORM1` , `FLD0102` ) ;
57+ expect ( range ?. start ) . toBe ( 17 ) ;
58+ expect ( range ?. end ) . toBe ( 17 ) ;
59+
60+ } ) ;
61+
3862 it ( 'No duplicate RecordInfo' , ( ) => {
3963 let dds = new DisplayFile ( ) ;
4064 dds . parse ( dspf1 ) ;
You can’t perform that action at this time.
0 commit comments