1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-02 10:56:25 -07:00

fix code smells for deepsource

This commit is contained in:
o.nihilist 2024-12-19 11:08:02 +01:00 committed by GitHub
parent c43a15bb0a
commit 3b8fcc2558
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,8 +75,8 @@ func TestServeErrorPage(t *testing.T) {
assert.Equal(t, "text/html; charset=utf-8", writer.Header().Get("Content-Type"))
// Check the response body for the error message
//assert.Contains(t, body, err) // Check if the body contains the error message
//assert.Contains(t, body, "Error") // Check if the body contains the error title or header
//assert.Contains(t, body, err) Check if the body contains the error message
//assert.Contains(t, body, "Error") Check if the body contains the error title or header
}
func TestServeError(t *testing.T) {
@ -132,11 +132,9 @@ func TestServeError(t *testing.T) {
if responseMap["error"] != tt.expected {
t.Errorf("Expected error %v, got %v", tt.expected, responseMap["error"])
}
} else {
} else if rr.Body.String() != tt.expected {
// Check if the response body matches the expected error message
if rr.Body.String() != tt.expected {
t.Errorf("Expected response %v, got %v", tt.expected, rr.Body.String())
}
t.Errorf("Expected response %v, got %v", tt.expected, rr.Body.String())
}
})
}