File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,41 @@ subpackages:
71
71
}, cfg .Subpackages [0 ].Dependencies .Runtime )
72
72
}
73
73
74
+ func Test_rangeSubstitutions (t * testing.T ) {
75
+ fp := filepath .Join (os .TempDir (), "melange-test-applySubstitutionsInProvides" )
76
+ if err := os .WriteFile (fp , []byte (`
77
+ package:
78
+ name: range-substitutions
79
+ version: 0.0.1
80
+ epoch: 7
81
+ description: example using a range in subpackages
82
+
83
+ data:
84
+ - name: I-am-a-range
85
+ items:
86
+ a: A
87
+ b: B
88
+
89
+ subpackages:
90
+ - range: I-am-a-range
91
+ name: ${{range.key}}
92
+ description: ${{range.value}}
93
+ options:
94
+ no-provides: true
95
+ dependencies:
96
+ runtime:
97
+ - wow-some-kinda-dynamically-linked-library-i-guess=1.0
98
+ ` ), 0644 ); err != nil {
99
+ t .Fatal (err )
100
+ }
101
+ cfg , err := ParseConfiguration (fp )
102
+ if err != nil {
103
+ t .Fatalf ("failed to parse configuration: %s" , err )
104
+ }
105
+ require .Equal (t , cfg .Subpackages [0 ].Dependencies .Runtime [0 ], "wow-some-kinda-dynamically-linked-library-i-guess=1.0" )
106
+ require .True (t , cfg .Subpackages [0 ].Options .NoProvides )
107
+ }
108
+
74
109
func Test_propagatePipelines (t * testing.T ) {
75
110
fp := filepath .Join (os .TempDir (), "melange-test-propagatePipelines" )
76
111
if err := os .WriteFile (fp , []byte (`
You can’t perform that action at this time.
0 commit comments