@@ -116,7 +116,8 @@ func TestDivergence(t *testing.T) {
116
116
{
117
117
name : "no divergence" ,
118
118
styles : styles {
119
- Clear : "StyleClear" ,
119
+ Clear : "StyleClear" ,
120
+ Divergence : "StyleDivergence" ,
120
121
},
121
122
symbols : symbols {
122
123
Ahead : "↓·" ,
@@ -133,7 +134,8 @@ func TestDivergence(t *testing.T) {
133
134
{
134
135
name : "ahead only" ,
135
136
styles : styles {
136
- Clear : "StyleClear" ,
137
+ Clear : "StyleClear" ,
138
+ Divergence : "StyleDivergence" ,
137
139
},
138
140
symbols : symbols {
139
141
Ahead : "↓·" ,
@@ -145,12 +147,13 @@ func TestDivergence(t *testing.T) {
145
147
BehindCount : 0 ,
146
148
},
147
149
},
148
- want : "StyleClear " + "↓·4" ,
150
+ want : "StyleClearStyleDivergence " + "↓·4" ,
149
151
},
150
152
{
151
153
name : "behind only" ,
152
154
styles : styles {
153
- Clear : "StyleClear" ,
155
+ Clear : "StyleClear" ,
156
+ Divergence : "StyleDivergence" ,
154
157
},
155
158
symbols : symbols {
156
159
Ahead : "↓·" ,
@@ -162,12 +165,13 @@ func TestDivergence(t *testing.T) {
162
165
BehindCount : 12 ,
163
166
},
164
167
},
165
- want : "StyleClear " + "↑·12" ,
168
+ want : "StyleClearStyleDivergence " + "↑·12" ,
166
169
},
167
170
{
168
171
name : "diverged both ways" ,
169
172
styles : styles {
170
- Clear : "StyleClear" ,
173
+ Clear : "StyleClear" ,
174
+ Divergence : "StyleDivergence" ,
171
175
},
172
176
symbols : symbols {
173
177
Ahead : "↓·" ,
@@ -179,67 +183,135 @@ func TestDivergence(t *testing.T) {
179
183
BehindCount : 128 ,
180
184
},
181
185
},
182
- want : "StyleClear" + "↑·128↓·41" ,
186
+ want : "StyleClearStyleDivergence" + "↑·128↓·41" ,
187
+ },
188
+ {
189
+ name : "divergence-space:true and ahead:0" ,
190
+ styles : styles {
191
+ Clear : "StyleClear" ,
192
+ Divergence : "StyleDivergence" ,
193
+ },
194
+ symbols : symbols {
195
+ Ahead : "↓·" ,
196
+ Behind : "↑·" ,
197
+ },
198
+ options : options {
199
+ DivergenceSpace : true ,
200
+ },
201
+ st : & gitstatus.Status {
202
+ Porcelain : gitstatus.Porcelain {
203
+ AheadCount : 0 ,
204
+ BehindCount : 12 ,
205
+ },
206
+ },
207
+ want : "StyleClearStyleDivergence" + "↑·12" ,
208
+ },
209
+ {
210
+ name : "divergence-space:false and diverged both ways" ,
211
+ styles : styles {
212
+ Clear : "StyleClear" ,
213
+ Divergence : "StyleDivergence" ,
214
+ },
215
+ symbols : symbols {
216
+ Ahead : "↓·" ,
217
+ Behind : "↑·" ,
218
+ },
219
+ options : options {
220
+ DivergenceSpace : true ,
221
+ SwapDivergence : false ,
222
+ },
223
+ st : & gitstatus.Status {
224
+ Porcelain : gitstatus.Porcelain {
225
+ AheadCount : 41 ,
226
+ BehindCount : 128 ,
227
+ },
228
+ },
229
+ want : "StyleClearStyleDivergence" + "↑·128 ↓·41" ,
230
+ },
231
+ {
232
+ name : "divergence-space:true and diverged both ways" ,
233
+ styles : styles {
234
+ Clear : "StyleClear" ,
235
+ Divergence : "StyleDivergence" ,
236
+ },
237
+ symbols : symbols {
238
+ Ahead : "↓·" ,
239
+ Behind : "↑·" ,
240
+ },
241
+ options : options {
242
+ DivergenceSpace : true ,
243
+ SwapDivergence : true ,
244
+ },
245
+ st : & gitstatus.Status {
246
+ Porcelain : gitstatus.Porcelain {
247
+ AheadCount : 41 ,
248
+ BehindCount : 128 ,
249
+ },
250
+ },
251
+ want : "StyleClearStyleDivergence" + "↓·41 ↑·128" ,
183
252
},
184
253
{
185
254
name : "swap divergence ahead only" ,
186
255
styles : styles {
187
- Clear : "StyleClear" ,
256
+ Clear : "StyleClear" ,
257
+ Divergence : "StyleDivergence" ,
188
258
},
189
259
symbols : symbols {
190
260
Ahead : "↓·" ,
191
261
Behind : "↑·" ,
192
262
},
193
263
options : options {
194
- SwapDivergence : true ,
264
+ SwapDivergence : true ,
195
265
},
196
266
st : & gitstatus.Status {
197
267
Porcelain : gitstatus.Porcelain {
198
268
AheadCount : 4 ,
199
269
BehindCount : 0 ,
200
270
},
201
271
},
202
- want : "StyleClear " + "↓·4" ,
272
+ want : "StyleClearStyleDivergence " + "↓·4" ,
203
273
},
204
274
{
205
275
name : "swap divergence behind only" ,
206
276
styles : styles {
207
- Clear : "StyleClear" ,
277
+ Clear : "StyleClear" ,
278
+ Divergence : "StyleDivergence" ,
208
279
},
209
280
symbols : symbols {
210
281
Ahead : "↓·" ,
211
282
Behind : "↑·" ,
212
283
},
213
284
options : options {
214
- SwapDivergence : true ,
285
+ SwapDivergence : true ,
215
286
},
216
287
st : & gitstatus.Status {
217
288
Porcelain : gitstatus.Porcelain {
218
289
AheadCount : 0 ,
219
290
BehindCount : 12 ,
220
291
},
221
292
},
222
- want : "StyleClear " + "↑·12" ,
293
+ want : "StyleClearStyleDivergence " + "↑·12" ,
223
294
},
224
295
{
225
296
name : "swap divergence both ways" ,
226
297
styles : styles {
227
- Clear : "StyleClear" ,
298
+ Clear : "StyleClear" ,
299
+ Divergence : "StyleDivergence" ,
228
300
},
229
301
symbols : symbols {
230
302
Ahead : "↓·" ,
231
303
Behind : "↑·" ,
232
304
},
233
305
options : options {
234
- SwapDivergence : true ,
306
+ SwapDivergence : true ,
235
307
},
236
308
st : & gitstatus.Status {
237
309
Porcelain : gitstatus.Porcelain {
238
310
AheadCount : 41 ,
239
311
BehindCount : 128 ,
240
312
},
241
313
},
242
- want : "StyleClear " + "↓·41↑·128" ,
314
+ want : "StyleClearStyleDivergence " + "↓·41↑·128" ,
243
315
},
244
316
}
245
317
for _ , tt := range tests {
0 commit comments