@@ -46,6 +46,9 @@ func TestYamlDocument_parseSingleJobReference(t *testing.T) {
46
46
const jobRef7 = `
47
47
- deploy:
48
48
serial-group: deploy-group`
49
+ const jobRef8 = `
50
+ - deploy:
51
+ override-with: foo/deploy`
49
52
50
53
type fields struct {
51
54
Content []byte
@@ -471,6 +474,59 @@ func TestYamlDocument_parseSingleJobReference(t *testing.T) {
471
474
},
472
475
},
473
476
},
477
+ {
478
+ name : "Job reference with override" ,
479
+ fields : fields {Content : []byte (jobRef8 )},
480
+ args : args {jobRefNode : getFirstChildOfType (GetRootNode ([]byte (jobRef8 )), "block_sequence_item" )},
481
+ want : ast.JobRef {
482
+ JobName : "deploy" ,
483
+ JobRefRange : protocol.Range {
484
+ Start : protocol.Position {
485
+ Line : 1 ,
486
+ Character : 0 ,
487
+ },
488
+ End : protocol.Position {
489
+ Line : 2 ,
490
+ Character : 29 ,
491
+ },
492
+ },
493
+ JobNameRange : protocol.Range {
494
+ Start : protocol.Position {
495
+ Line : 1 ,
496
+ Character : 2 ,
497
+ },
498
+ End : protocol.Position {
499
+ Line : 1 ,
500
+ Character : 8 ,
501
+ },
502
+ },
503
+ StepName : "deploy" ,
504
+ StepNameRange : protocol.Range {
505
+ Start : protocol.Position {
506
+ Line : 1 ,
507
+ Character : 2 ,
508
+ },
509
+ End : protocol.Position {
510
+ Line : 1 ,
511
+ Character : 8 ,
512
+ },
513
+ },
514
+ Parameters : make (map [string ]ast.ParameterValue ),
515
+ HasMatrix : false ,
516
+ MatrixParams : make (map [string ][]ast.ParameterValue ),
517
+ OverrideWith : "foo/deploy" ,
518
+ OverrideWithRange : protocol.Range {
519
+ Start : protocol.Position {
520
+ Line : 2 ,
521
+ Character : 19 ,
522
+ },
523
+ End : protocol.Position {
524
+ Line : 2 ,
525
+ Character : 29 ,
526
+ },
527
+ },
528
+ },
529
+ },
474
530
}
475
531
for _ , tt := range tests {
476
532
t .Run (tt .name , func (t * testing.T ) {
0 commit comments