@@ -47,7 +47,7 @@ func TestLabelSearchIssues(t *testing.T) {
4747
4848 tests := []struct {
4949 name string
50- visibilities []bool
50+ visibilities []bool // true == private
5151 wantIntegrity Integrity
5252 wantConfidential Confidentiality
5353 }{
@@ -250,71 +250,40 @@ func TestLabelGist(t *testing.T) {
250250
251251 t .Run ("public gist is untrusted and public" , func (t * testing.T ) {
252252 t .Parallel ()
253- label := LabelGist (true )
253+ label := LabelGist ()
254254 assert .Equal (t , IntegrityUntrusted , label .Integrity )
255255 assert .Equal (t , ConfidentialityPublic , label .Confidentiality )
256256 })
257257
258- t .Run ("secret gist is untrusted and private " , func (t * testing.T ) {
258+ t .Run ("secret gist is untrusted and public " , func (t * testing.T ) {
259259 t .Parallel ()
260- label := LabelGist (false )
260+ label := LabelGist ()
261261 assert .Equal (t , IntegrityUntrusted , label .Integrity )
262- assert .Equal (t , ConfidentialityPrivate , label .Confidentiality )
262+ assert .Equal (t , ConfidentialityPublic , label .Confidentiality )
263263 })
264264}
265265
266266func TestLabelGistList (t * testing.T ) {
267267 t .Parallel ()
268268
269- tests := []struct {
270- name string
271- visibilities []bool // true == public
272- wantConfidential Confidentiality
273- }{
274- {
275- name : "empty result is treated as public" ,
276- wantConfidential : ConfidentialityPublic ,
277- },
278- {
279- name : "all public gists stay public" ,
280- visibilities : []bool {true , true },
281- wantConfidential : ConfidentialityPublic ,
282- },
283- {
284- name : "any secret gist flips to private" ,
285- visibilities : []bool {true , false , true },
286- wantConfidential : ConfidentialityPrivate ,
287- },
288- {
289- name : "all secret gists stay private" ,
290- visibilities : []bool {false , false },
291- wantConfidential : ConfidentialityPrivate ,
292- },
293- }
294-
295- for _ , tc := range tests {
296- t .Run (tc .name , func (t * testing.T ) {
297- t .Parallel ()
298- label := LabelGistList (tc .visibilities )
299- assert .Equal (t , IntegrityUntrusted , label .Integrity )
300- assert .Equal (t , tc .wantConfidential , label .Confidentiality )
301- })
302- }
269+ label := LabelGistList ()
270+ assert .Equal (t , IntegrityUntrusted , label .Integrity )
271+ assert .Equal (t , ConfidentialityPublic , label .Confidentiality )
303272}
304273
305274func TestLabelProject (t * testing.T ) {
306275 t .Parallel ()
307276
308277 t .Run ("public project is untrusted and public" , func (t * testing.T ) {
309278 t .Parallel ()
310- label := LabelProject (true )
279+ label := LabelProject (false )
311280 assert .Equal (t , IntegrityUntrusted , label .Integrity )
312281 assert .Equal (t , ConfidentialityPublic , label .Confidentiality )
313282 })
314283
315284 t .Run ("private project is untrusted and private" , func (t * testing.T ) {
316285 t .Parallel ()
317- label := LabelProject (false )
286+ label := LabelProject (true )
318287 assert .Equal (t , IntegrityUntrusted , label .Integrity )
319288 assert .Equal (t , ConfidentialityPrivate , label .Confidentiality )
320289 })
0 commit comments