@@ -99,59 +99,62 @@ describe('modules/versioning/cargo/index', () => {
99
99
} ) ;
100
100
101
101
it . each `
102
- currentValue | rangeStrategy | currentVersion | newVersion | expected
103
- ${ '*' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
104
- ${ '1' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
105
- ${ '1.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
106
- ${ '1.0.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
107
- ${ '^1' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
108
- ${ '^1.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
109
- ${ '^1.0.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
110
- ${ '~1' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
111
- ${ '~0.7' } | ${ 'replace' } | ${ '0.7.3' } | ${ '0.8.5' } | ${ '~0.8' }
112
- ${ '~1.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
113
- ${ '~1.0.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
114
- ${ null } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ null }
115
- ${ '*' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '*' }
116
- ${ '=1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
117
- ${ ' =1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
118
- ${ '= 1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '= 1.1.0' }
119
- ${ ' = 1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
120
- ${ ' = 1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
121
- ${ '= 1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '= 1.1.0' }
122
- ${ '1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '1.1.0' }
123
- ${ '^1.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.0.7' } | ${ '^1.0.7' }
124
- ${ '^1.0.0' } | ${ 'replace' } | ${ '1.0.0' } | ${ '2.0.7' } | ${ '^2.0.0' }
125
- ${ '1.0.0' } | ${ 'replace' } | ${ '1.0.0' } | ${ '2.0.7' } | ${ '2.0.0' }
126
- ${ '^1' } | ${ 'bump' } | ${ '1.0.0' } | ${ '2.1.7' } | ${ '^2.1.7' }
127
- ${ '~1' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.7' } | ${ '~1.1.7' }
128
- ${ '5' } | ${ 'bump' } | ${ '5.0.0' } | ${ '5.1.7' } | ${ '5.1.7' }
129
- ${ '5' } | ${ 'bump' } | ${ '5.0.0' } | ${ '6.1.7' } | ${ '6.1.7' }
130
- ${ '5.0' } | ${ 'bump' } | ${ '5.0.0' } | ${ '5.0.7' } | ${ '5.0.7' }
131
- ${ '5.0' } | ${ 'bump' } | ${ '5.0.0' } | ${ '5.1.7' } | ${ '5.1.7' }
132
- ${ '5.0' } | ${ 'bump' } | ${ '5.0.0' } | ${ '6.1.7' } | ${ '6.1.7' }
133
- ${ '0.5' } | ${ 'bump' } | ${ '0.5.0' } | ${ '0.5.1' } | ${ '0.5.1' }
134
- ${ '0.5' } | ${ 'bump' } | ${ '0.5.0' } | ${ '0.6.1' } | ${ '0.6.1' }
135
- ${ '1.2' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.3.0' } | ${ '1.2' }
136
- ${ '5.0' } | ${ 'replace' } | ${ '5.0.0' } | ${ '5.1.7' } | ${ '5.0' }
137
- ${ '5.0' } | ${ 'replace' } | ${ '5.0.0' } | ${ '6.1.7' } | ${ '6.0' }
138
- ${ '0.5' } | ${ 'replace' } | ${ '0.5.0' } | ${ '0.6.1' } | ${ '0.6' }
139
- ${ '=1.0.0' } | ${ 'replace' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
140
- ${ '1.0.*' } | ${ 'replace' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '1.1.*' }
141
- ${ '1.*' } | ${ 'replace' } | ${ '1.0.0' } | ${ '2.1.0' } | ${ '2.*' }
142
- ${ '~0.6.1' } | ${ 'replace' } | ${ '0.6.8' } | ${ '0.7.0-rc.2' } | ${ '~0.7.0-rc' }
143
- ${ '<1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '<1.5.1' }
144
- ${ '< 1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '< 1.5.1' }
145
- ${ '< 1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '< 1.5.1' }
146
- ${ '<=1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '<=1.5.0' }
147
- ${ '<= 1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '<= 1.5.0' }
148
- ${ '<= 1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '<= 1.5.0' }
149
- ${ '>= 0.1.21, < 0.2.0' } | ${ 'bump' } | ${ '0.1.21' } | ${ '0.1.24' } | ${ '>= 0.1.24, < 0.2.0' }
150
- ${ '>= 0.1.21, <= 0.2.0' } | ${ 'bump' } | ${ '0.1.21' } | ${ '0.1.24' } | ${ '>= 0.1.24, <= 0.2.0' }
151
- ${ '>= 0.0.1, <= 0.1' } | ${ 'bump' } | ${ '0.0.1' } | ${ '0.0.2' } | ${ '>= 0.0.2, <= 0.1' }
152
- ${ '>= 1.2.3, <= 1' } | ${ 'bump' } | ${ '1.2.3' } | ${ '1.2.4' } | ${ '>= 1.2.4, <= 1' }
153
- ${ '>= 1.2.3, <= 1.0' } | ${ 'bump' } | ${ '1.2.3' } | ${ '1.2.4' } | ${ '>= 1.2.4, <= 1.2' }
154
- ${ '>= 0.0.1, < 0.1' } | ${ 'bump' } | ${ '0.1.0' } | ${ '0.2.1' } | ${ '>= 0.2.1, < 0.3' }
102
+ currentValue | rangeStrategy | currentVersion | newVersion | expected
103
+ ${ '*' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
104
+ ${ '1' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
105
+ ${ '1.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
106
+ ${ '1.0.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
107
+ ${ '^1' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
108
+ ${ '^1.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
109
+ ${ '^1.0.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
110
+ ${ '~1' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
111
+ ${ '~0.7' } | ${ 'replace' } | ${ '0.7.3' } | ${ '0.8.5' } | ${ '~0.8' }
112
+ ${ '~1.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
113
+ ${ '~1.0.0' } | ${ 'pin' } | ${ '1.0.0' } | ${ '1.0.0' } | ${ '=1.0.0' }
114
+ ${ null } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ null }
115
+ ${ '*' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '*' }
116
+ ${ '=1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
117
+ ${ ' =1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
118
+ ${ '= 1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '= 1.1.0' }
119
+ ${ ' = 1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
120
+ ${ ' = 1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
121
+ ${ '= 1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '= 1.1.0' }
122
+ ${ '1.0.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '1.1.0' }
123
+ ${ '^1.0' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.0.7' } | ${ '^1.0.7' }
124
+ ${ '^1.0.0' } | ${ 'replace' } | ${ '1.0.0' } | ${ '2.0.7' } | ${ '^2.0.0' }
125
+ ${ '1.0.0' } | ${ 'replace' } | ${ '1.0.0' } | ${ '2.0.7' } | ${ '2.0.0' }
126
+ ${ '^1' } | ${ 'bump' } | ${ '1.0.0' } | ${ '2.1.7' } | ${ '^2.1.7' }
127
+ ${ '~1' } | ${ 'bump' } | ${ '1.0.0' } | ${ '1.1.7' } | ${ '~1.1.7' }
128
+ ${ '5' } | ${ 'bump' } | ${ '5.0.0' } | ${ '5.1.7' } | ${ '5.1.7' }
129
+ ${ '5' } | ${ 'bump' } | ${ '5.0.0' } | ${ '6.1.7' } | ${ '6.1.7' }
130
+ ${ '5.0' } | ${ 'bump' } | ${ '5.0.0' } | ${ '5.0.7' } | ${ '5.0.7' }
131
+ ${ '5.0' } | ${ 'bump' } | ${ '5.0.0' } | ${ '5.1.7' } | ${ '5.1.7' }
132
+ ${ '5.0' } | ${ 'bump' } | ${ '5.0.0' } | ${ '6.1.7' } | ${ '6.1.7' }
133
+ ${ '0.5' } | ${ 'bump' } | ${ '0.5.0' } | ${ '0.5.1' } | ${ '0.5.1' }
134
+ ${ '0.5' } | ${ 'bump' } | ${ '0.5.0' } | ${ '0.6.1' } | ${ '0.6.1' }
135
+ ${ '1.2' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.3.0' } | ${ '1.2' }
136
+ ${ '5.0' } | ${ 'replace' } | ${ '5.0.0' } | ${ '5.1.7' } | ${ '5.0' }
137
+ ${ '5.0' } | ${ 'replace' } | ${ '5.0.0' } | ${ '6.1.7' } | ${ '6.0' }
138
+ ${ '0.5' } | ${ 'replace' } | ${ '0.5.0' } | ${ '0.6.1' } | ${ '0.6' }
139
+ ${ '=1.0.0' } | ${ 'replace' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '=1.1.0' }
140
+ ${ '1.0.*' } | ${ 'replace' } | ${ '1.0.0' } | ${ '1.1.0' } | ${ '1.1.*' }
141
+ ${ '1.*' } | ${ 'replace' } | ${ '1.0.0' } | ${ '2.1.0' } | ${ '2.*' }
142
+ ${ '~0.6.1' } | ${ 'replace' } | ${ '0.6.8' } | ${ '0.7.0-rc.2' } | ${ '~0.7.0-rc' }
143
+ ${ '<1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '<1.5.1' }
144
+ ${ '< 1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '< 1.5.1' }
145
+ ${ '< 1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '< 1.5.1' }
146
+ ${ '<=1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '<=1.5.0' }
147
+ ${ '<= 1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '<= 1.5.0' }
148
+ ${ '<= 1.3.4' } | ${ 'replace' } | ${ '1.2.3' } | ${ '1.5.0' } | ${ '<= 1.5.0' }
149
+ ${ '>= 0.1.21, < 0.2.0' } | ${ 'bump' } | ${ '0.1.21' } | ${ '0.1.24' } | ${ '>= 0.1.24, < 0.2.0' }
150
+ ${ '>= 0.1.21, <= 0.2.0' } | ${ 'bump' } | ${ '0.1.21' } | ${ '0.1.24' } | ${ '>= 0.1.24, <= 0.2.0' }
151
+ ${ '>= 0.0.1, <= 0.1' } | ${ 'bump' } | ${ '0.0.1' } | ${ '0.0.2' } | ${ '>= 0.0.2, <= 0.1' }
152
+ ${ '>= 1.2.3, <= 1' } | ${ 'bump' } | ${ '1.2.3' } | ${ '1.2.4' } | ${ '>= 1.2.4, <= 1' }
153
+ ${ '>= 1.2.3, <= 1.0' } | ${ 'bump' } | ${ '1.2.3' } | ${ '1.2.4' } | ${ '>= 1.2.4, <= 1.2' }
154
+ ${ '>= 0.0.1, < 0.1' } | ${ 'bump' } | ${ '0.1.0' } | ${ '0.2.1' } | ${ '>= 0.2.1, < 0.3' }
155
+ ${ '0.1.0+metadata' } | ${ 'bump' } | ${ '0.1.0+metadata' } | ${ '0.2.0+metadata' } | ${ '0.2.0' }
156
+ ${ '=0.1.0+metadata' } | ${ 'bump' } | ${ '0.1.0+metadata' } | ${ '0.2.0+metadata' } | ${ '=0.2.0' }
157
+ ${ '0.1.0+metadata' } | ${ 'replace' } | ${ '0.1.0+metadata' } | ${ '0.2.0+metadata' } | ${ '0.2.0' }
155
158
` (
156
159
'getNewValue("$currentValue", "$rangeStrategy", "$currentVersion", "$newVersion") === "$expected"' ,
157
160
( { currentValue, rangeStrategy, currentVersion, newVersion, expected } ) => {
0 commit comments