(t *testing.T)
| 43 | } |
| 44 | |
| 45 | func TestLabelSearchIssues(t *testing.T) { |
| 46 | t.Parallel() |
| 47 | |
| 48 | tests := []struct { |
| 49 | name string |
| 50 | visibilities []bool // true == private |
| 51 | wantIntegrity Integrity |
| 52 | wantConfidential Confidentiality |
| 53 | }{ |
| 54 | { |
| 55 | name: "empty result is treated as public", |
| 56 | wantIntegrity: IntegrityUntrusted, |
| 57 | wantConfidential: ConfidentialityPublic, |
| 58 | }, |
| 59 | { |
| 60 | name: "single public repo", |
| 61 | visibilities: []bool{false}, |
| 62 | wantIntegrity: IntegrityUntrusted, |
| 63 | wantConfidential: ConfidentialityPublic, |
| 64 | }, |
| 65 | { |
| 66 | name: "all public repos stay public", |
| 67 | visibilities: []bool{false, false, false}, |
| 68 | wantIntegrity: IntegrityUntrusted, |
| 69 | wantConfidential: ConfidentialityPublic, |
| 70 | }, |
| 71 | { |
| 72 | name: "mixed public and private repos become untrusted private", |
| 73 | visibilities: []bool{false, true, false}, |
| 74 | wantIntegrity: IntegrityUntrusted, |
| 75 | wantConfidential: ConfidentialityPrivate, |
| 76 | }, |
| 77 | { |
| 78 | name: "all private repos stay trusted private", |
| 79 | visibilities: []bool{true, true}, |
| 80 | wantIntegrity: IntegrityTrusted, |
| 81 | wantConfidential: ConfidentialityPrivate, |
| 82 | }, |
| 83 | } |
| 84 | |
| 85 | for _, tc := range tests { |
| 86 | t.Run(tc.name, func(t *testing.T) { |
| 87 | t.Parallel() |
| 88 | label := LabelSearchIssues(tc.visibilities) |
| 89 | assert.Equal(t, tc.wantIntegrity, label.Integrity) |
| 90 | assert.Equal(t, tc.wantConfidential, label.Confidentiality) |
| 91 | }) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func TestLabelRepoMetadata(t *testing.T) { |
| 96 | t.Parallel() |
nothing calls this directly
no test coverage detected