skipOnAuthError skips the test if the error indicates missing authentication.
(t *testing.T, err error)
| 149 | |
| 150 | // skipOnAuthError skips the test if the error indicates missing authentication. |
| 151 | func skipOnAuthError(t *testing.T, err error) { |
| 152 | t.Helper() |
| 153 | if err == nil { |
| 154 | return |
| 155 | } |
| 156 | errStr := err.Error() |
| 157 | if strings.Contains(errStr, "auth") || strings.Contains(errStr, "forbidden") || strings.Contains(errStr, "authentication token not found") { |
| 158 | t.Skip("Skipping test due to authentication requirements") |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | // TestCheckRemoteSymlink verifies that checkRemoteSymlink correctly classifies |
| 163 | // directories, files, and nonexistent paths when called against the GitHub Contents API. |
no test coverage detected