@@ -218,42 +218,42 @@ func TestPrepareWikiFileName(t *testing.T) {
218
218
assert .NoError (t , err )
219
219
220
220
tests := []struct {
221
- name string
222
- arg string
223
- hasWiki bool
224
- wikiPath string
225
- wantErr bool
221
+ name string
222
+ arg string
223
+ existence bool
224
+ wikiPath string
225
+ wantErr bool
226
226
}{{
227
- name : "add suffix" ,
228
- arg : "home " ,
229
- hasWiki : true ,
230
- wikiPath : "home .md" ,
231
- wantErr : false ,
227
+ name : "add suffix" ,
228
+ arg : "Home " ,
229
+ existence : true ,
230
+ wikiPath : "Home .md" ,
231
+ wantErr : false ,
232
232
}, {
233
- name : "test special chars" ,
234
- arg : "home of and & or wiki page!" ,
235
- hasWiki : true ,
236
- wikiPath : "home-of-and-%26-or-wiki-page%21.md" ,
237
- wantErr : false ,
233
+ name : "test special chars" ,
234
+ arg : "home of and & or wiki page!" ,
235
+ existence : false ,
236
+ wikiPath : "home-of-and-%26-or-wiki-page%21.md" ,
237
+ wantErr : false ,
238
238
}, {
239
- name : "strange cases" ,
240
- arg : "... " ,
241
- hasWiki : true ,
242
- wikiPath : "... .md" ,
243
- wantErr : false ,
239
+ name : "fount unescaped cases" ,
240
+ arg : "Unescaped File " ,
241
+ existence : true ,
242
+ wikiPath : "Unescaped File .md" ,
243
+ wantErr : false ,
244
244
}}
245
245
for _ , tt := range tests {
246
246
t .Run (tt .name , func (t * testing.T ) {
247
- isWikiExist , newWikiPath , err := prepareWikiFileName (gitRepo , tt .arg )
247
+ existence , newWikiPath , err := prepareWikiFileName (gitRepo , tt .arg )
248
248
if (err != nil ) != tt .wantErr {
249
249
assert .NoError (t , err )
250
250
return
251
251
}
252
- if isWikiExist != tt .hasWiki {
253
- if isWikiExist {
254
- t .Errorf ("expect to have no wiki but we detect one" )
252
+ if existence != tt .existence {
253
+ if existence {
254
+ t .Errorf ("expect to find no escaped file but we detect one" )
255
255
} else {
256
- t .Errorf ("expect to have wiki but we could not detect one" )
256
+ t .Errorf ("expect to find an escaped file but we could not detect one" )
257
257
}
258
258
}
259
259
assert .Equal (t , tt .wikiPath , newWikiPath )
0 commit comments