(t *testing.T)
| 90 | } |
| 91 | |
| 92 | func TestIsPermissionErrorStr(t *testing.T) { |
| 93 | tests := []struct { |
| 94 | name string |
| 95 | s string |
| 96 | expected bool |
| 97 | }{ |
| 98 | { |
| 99 | name: "Combined message with exit status 4", |
| 100 | s: "exit status 4 not logged into any GitHub hosts", |
| 101 | expected: true, |
| 102 | }, |
| 103 | { |
| 104 | name: "Output only contains gh auth login", |
| 105 | s: "Run gh auth login to proceed", |
| 106 | expected: true, |
| 107 | }, |
| 108 | { |
| 109 | name: "Empty string", |
| 110 | s: "", |
| 111 | expected: false, |
| 112 | }, |
| 113 | { |
| 114 | name: "Unrelated combined message", |
| 115 | s: "exit status 1 unknown field", |
| 116 | expected: false, |
| 117 | }, |
| 118 | } |
| 119 | |
| 120 | for _, tt := range tests { |
| 121 | t.Run(tt.name, func(t *testing.T) { |
| 122 | result := isPermissionErrorStr(tt.s) |
| 123 | if result != tt.expected { |
| 124 | t.Errorf("Expected %v, got %v", tt.expected, result) |
| 125 | } |
| 126 | }) |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | func TestBuildAuditData(t *testing.T) { |
| 131 | // Create test data |
nothing calls this directly
no test coverage detected