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', () => {
16
16
` A R GLOBAL ` ,
17
17
` A SLNO(04) ` ,
18
18
` 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 ` ,
19
25
] ;
20
26
21
27
it ( 'getRangeForFormat' , ( ) => {
@@ -35,6 +41,24 @@ describe('DisplayFile tests', () => {
35
41
expect ( range ?. end ) . toBe ( 3 ) ;
36
42
} ) ;
37
43
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
+
38
62
it ( 'No duplicate RecordInfo' , ( ) => {
39
63
let dds = new DisplayFile ( ) ;
40
64
dds . parse ( dspf1 ) ;
You can’t perform that action at this time.
0 commit comments